예제 #1
0
 def get_initial(self):
     """
     Get initial data for the form
     """
     q = BlogSettings.all().get()
     if q is not None:
         self.initial['coments_authenticate'] = q.coments_authenticate
     return self.initial.copy()
예제 #2
0
 def form_valid(self, form):
     q = BlogSettings.all().get()
     if q is not None:
         q.coments_authenticate = form.cleaned_data['coments_authenticate']
         q.put()
     else:
         q = BlogSettings(coments_authenticate=form.cleaned_data['coments_authenticate']).put()
     return super(Admin_Blog_Settings_IndexController, self).form_valid(form)
예제 #3
0
파일: views.py 프로젝트: ogonbat/blogbastik
 def get_context_data(self, slug, **kwargs):
     context = super(PostHomePage, self).get_context_data(**kwargs)
     settings = BlogSettings.all().get()
     posts = Posts.all().filter("is_active =", True).filter("slug =", slug).get()
     context['post'] = posts
     context['comments'] = posts.comments_set.fetch(None)
     context['settings'] = settings
     return context