make master pep8-ready again
This commit is contained in:
@@ -7,7 +7,7 @@ from .models import Post, Event, News, FetMeeting
|
|||||||
class MyPostForm(forms.ModelForm):
|
class MyPostForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Post
|
model = Post
|
||||||
fields = ['title', 'subtitle', 'tags', 'image', 'body', 'slug', 'author','public_date']
|
fields = ['title', 'subtitle', 'tags', 'image', 'body', 'slug', 'author', 'public_date']
|
||||||
|
|
||||||
widgets = {'body': CKEditorUploadingWidget(config_name='default')}
|
widgets = {'body': CKEditorUploadingWidget(config_name='default')}
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ class MyPostForm(forms.ModelForm):
|
|||||||
class MyNewsForm(MyPostForm):
|
class MyNewsForm(MyPostForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = News
|
model = News
|
||||||
fields = ['title', 'subtitle', 'tags', 'image', 'body', 'slug', 'author','public_date']
|
fields = ['title', 'subtitle', 'tags', 'image', 'body', 'slug', 'author', 'public_date']
|
||||||
|
|
||||||
widgets = {'body': CKEditorUploadingWidget(config_name='default')}
|
widgets = {'body': CKEditorUploadingWidget(config_name='default')}
|
||||||
|
|
||||||
@@ -32,8 +32,10 @@ class MyNewsForm(MyPostForm):
|
|||||||
class MyEventForm(MyPostForm):
|
class MyEventForm(MyPostForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Event
|
model = Event
|
||||||
fields = ['title', 'subtitle', 'tags', 'image', 'body',
|
fields = [
|
||||||
'event_start', 'event_end', 'event_place', 'slug', 'author','public_date']
|
'title', 'subtitle', 'tags', 'image', 'body', 'event_start', 'event_end',
|
||||||
|
'event_place', 'slug', 'author', 'public_date',
|
||||||
|
]
|
||||||
|
|
||||||
widgets = {'body': CKEditorUploadingWidget(config_name='default')}
|
widgets = {'body': CKEditorUploadingWidget(config_name='default')}
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,6 @@ class Post(models.Model):
|
|||||||
def author_member(self):
|
def author_member(self):
|
||||||
return Member.all_members.filter(nickname=self.author.username).first()
|
return Member.all_members.filter(nickname=self.author.username).first()
|
||||||
|
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
"save the post with some defaults"
|
"save the post with some defaults"
|
||||||
if (self.id is None) and (not self.slug):
|
if (self.id is None) and (not self.slug):
|
||||||
|
|||||||
@@ -35,11 +35,12 @@ def index(request):
|
|||||||
def tags(request, tag=""):
|
def tags(request, tag=""):
|
||||||
posts = deque(Post.objects.filter(tags__name=tag))
|
posts = deque(Post.objects.filter(tags__name=tag))
|
||||||
featured_post = Post.objects.filter(slug=tag).first()
|
featured_post = Post.objects.filter(slug=tag).first()
|
||||||
context= {
|
context = {
|
||||||
"posts": posts,
|
"posts": posts,
|
||||||
"featured_post":featured_post,
|
"featured_post": featured_post,
|
||||||
"tags_list": None}
|
"tags_list": None,
|
||||||
return render(request, 'posts/tag.html',context)
|
}
|
||||||
|
return render(request, 'posts/tag.html', context)
|
||||||
|
|
||||||
|
|
||||||
def show(request, id=None):
|
def show(request, id=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user