Ejemplo n.º 1
0
 def __init__(self, user, initial=None, action=None, request=None):
     if user is not None:
         initial = forms.fill_dict(initial,
                                   username=user.username,
                                   is_admin=user.is_admin,
                                   openid_logins=sorted(user.openid_logins))
     ProfileEditForm.__init__(self, user, initial, action, request)
Ejemplo n.º 2
0
 def __init__(self, topic=None, revision=None, initial=None, action=None,
              request=None):
     self.topic = topic
     self.revision = revision
     if topic is not None:
         text = (revision or topic.question).text
         initial = forms.fill_dict(initial, title=topic.title,
                                   text=text, tags=[x.name for x in topic.tags])
     forms.Form.__init__(self, initial, action, request)
Ejemplo n.º 3
0
 def __init__(self, user, initial=None, action=None, request=None):
     self.user = user
     self.auth_system = get_auth_system()
     if user is not None:
         initial = forms.fill_dict(initial, real_name=user.real_name)
         if not self.auth_system.email_managed_external:
             initial['email'] = user.email
     forms.Form.__init__(self, initial, action, request)
     if self.auth_system.email_managed_external:
         del self.fields['email']
Ejemplo n.º 4
0
 def __init__(self, user, initial=None, action=None, request=None):
     self.user = user
     self.auth_system = get_auth_system()
     if user is not None:
         initial = forms.fill_dict(initial, real_name=user.real_name)
         if not self.auth_system.email_managed_external:
             initial['email'] = user.email
     forms.Form.__init__(self, initial, action, request)
     if self.auth_system.email_managed_external:
         del self.fields['email']
Ejemplo n.º 5
0
 def __init__(self, topic=None, post=None, revision=None,
              initial=None, action=None):
     if post is not None:
         assert topic is None
         topic = post.topic
         self.post = post
         initial = forms.fill_dict(initial, text=(revision or post).text)
     else:
         self.post = None
     self.topic = topic
     self.revision = revision
     forms.Form.__init__(self, initial, action)
Ejemplo n.º 6
0
 def __init__(self,
              topic=None,
              revision=None,
              initial=None,
              action=None,
              request=None):
     self.topic = topic
     self.revision = revision
     if topic is not None:
         text = (revision or topic.question).text
         initial = forms.fill_dict(initial,
                                   title=topic.title,
                                   text=text,
                                   tags=[x.name for x in topic.tags])
     forms.Form.__init__(self, initial, action, request)
Ejemplo n.º 7
0
 def __init__(self,
              topic=None,
              post=None,
              revision=None,
              initial=None,
              action=None):
     if post is not None:
         assert topic is None
         topic = post.topic
         self.post = post
         initial = forms.fill_dict(initial, text=(revision or post).text)
     else:
         self.post = None
     self.topic = topic
     self.revision = revision
     forms.Form.__init__(self, initial, action)
Ejemplo n.º 8
0
 def __init__(self, user, initial=None, action=None, request=None):
     if user is not None:
         initial = forms.fill_dict(initial, username=user.username,
                                   is_admin=user.is_admin,
                                   openid_logins=sorted(user.openid_logins))
     ProfileEditForm.__init__(self, user, initial, action, request)