Пример #1
0
 def render(self):
     data = db.get_social_settings()
     if data:
         settings = data
         settings["updated"] = data["updated"].ctime() #format time
     else:
         settings = False
     return self.render_string('admin/uimodules/admin_settings_social.html',
                               settings=settings,
                               )
Пример #2
0
 def render(self):
     data = db.get_social_settings()
     if data: #repopulate form
         form = forms.AdminSettingsSocialForm(
             facebook=data["facebook"],
             googleplus=data["googleplus"],
             kakao=data["kakao"],
             twitter=data["twitter"],
             linkedin=data["linkedin"]
             )
     else:
         form = forms.AdminSettingsSocialForm() # from forms file
     return self.render_string('admin/forms/admin_settings_social_form.html',
                               form=form,
                               )