Ejemplo n.º 1
0
 def __init__(self, current_user, current_problem, *args, **kwargs):
     if current_user.is_authenticated():
         self.current_user_id = current_user.id
     else:
         self.current_user_id = None
     self.current_problem_id = current_problem.id
     Form.__init__(self, *args, **kwargs)
Ejemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     kwargs['csrf_enabled'] = False
     Form.__init__(self, *args, **kwargs)
     self.answer = None
     self.question_id = None
     self.userid1 = None
     self.userid2 = None
Ejemplo n.º 3
0
 def __init__(self, user=None):
     Form.__init__(self)
     if user:
         self.user = user
         self.first_name.data = self.user.first_name
         self.last_name.data = self.user.last_name
         self.email.data = self.user.email
Ejemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     # Possible groups a user can choose from are loaded into the permitted select
     groups = Group.query.filter(User.user_name == current_user.user_name, Group.group_name != "private").all()
     group_private = Group.query.filter(Group.group_name == "private").all()
     # Put the private group first
     self.permitted.choices = [(group.group_id, group.group_name) for group in group_private + groups]
     self.image_obj = None
Ejemplo n.º 5
0
 def __init__(self, *args, **kwargs):
     """Initialize the ChangeDateAndDepartmentForm object"""
     Form.__init__(self, *args, **kwargs)
     self.ds = None
     self.dept_id = None
     self.department.choices = [
         (dept.id, dept.name) for dept in Department.query.all()
     ]
Ejemplo n.º 6
0
 def __init__(self, member=None):
     Form.__init__(self)
     self.roles.choices = [(role.id, role.name) for role in Role.query.all()]
     self.member = member
     if self.member:
         self.first_name.data = self.member.first_name
         self.last_name.data = self.member.last_name
         self.email.data = self.member.email
         self.roles.data = [role.id for role in self.member.roles]
Ejemplo n.º 7
0
    def __init__(self, *args, **kwargs):
        """

        :param args:
        :param kwargs:
        :return:
        """
        Form.__init__(self, *args, **kwargs)
        self.user = None
Ejemplo n.º 8
0
    def __init__(self, place, *a, **kw):
        Form.__init__(self, *a, **kw)
        self.place = place
        self.level.choices = [(t.short_name, t.name) for t in models.PlaceType.all()]

        # Ensure that there are at least 5 empty slots
        empty_slots = sum(1 for role in self.data['roles'] if not role['name'].strip())
        for i in range(5-empty_slots):
            self.roles.append_entry()
Ejemplo n.º 9
0
    def __init__(self, *args, **kwargs):
        Form.__init__(self, *args, **kwargs)
        self.stop_id = kwargs['stop_id']
        self.ip = kwargs['ip']
        self.timestamp = kwargs['timestamp']

        if kwargs['stop_name']:
            self.stop_name = kwargs['stop_name']
        else:
            self.stop_name = "glargh"
Ejemplo n.º 10
0
    def __init__(self, *args, **kwargs):
        Form.__init__(self, *args, **kwargs)

        # Load subjects and users from database to populate select options
        users = ["All Users"] + [user.user_name for user in User.query.order_by(User.user_name).all()]

        image_query = Image.query.group_by(Image.subject).order_by(Image.subject).all()
        subjects = ["All Subjects"] + [image.subject for image in image_query]

        self.subject.choices = [["No Subjects", "Any Subject"]] + list(zip(subjects, subjects))
        self.user.choices = [["No Users", "Any User"]] + list(zip(users, users))
Ejemplo n.º 11
0
 def __init__(self, user=None, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     if user:
         self.email.data = user.email
         self.name.data = user.name
         self.nickname.data = user.nickname
         self.role_id.data = user.role_id
         self.address.data = user.address
         self.phone.data = user.phone
         self.timezone.data = user.timezone
         self.lang.data = user.lang
Ejemplo n.º 12
0
 def __init__(self, post=None, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.category_id.choices = Category.get_list()
     if post:
         self.id = kwargs.get("id") if kwargs.get("id") else 0
         self.title.data = post.title
         self.body.data = post.body
         self.extra_body.data = post.extra_body
         self.anonymous.data = post.anonymous
         self.category_id.data = post.category_id
         self.cover_picture_id.data = post.cover_picture_id
Ejemplo n.º 13
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     obj = kwargs.get('obj', False)
     if obj:
         self.title.data = obj.get('title', None)
         self.description.data = obj.get('description', None)
         self.uri.data = obj.get('uri', None)
         # only json dump if there's a value... cuz json'll make it null
         # and then cause it to be saved later as 'ids':'null'
         self.ids.data = json.dumps(obj.get('ids', None)) if obj.get('ids', None) else obj.get('ids', None)
         self.ctype.data = obj.get('type', None)
         self.levels.data = json.dumps(obj.get('levels', None)) if obj.get('levels', None) else obj.get('levels', None)
         self.relations.data = json.dumps(obj.get('relations', None)) if obj.get('relations', None) else obj.get('relations', None)
         self.linked_content.data = json.dumps(obj.get('linked_content', None)) if obj.get('linked_content', None) else obj.get('linked_content', None)
Ejemplo n.º 14
0
 def __init__(self, page=None):
     Form.__init__(self)
     self.page = page
     self.templates.choices = [(t.id, t.name) for t in Template.query.all()]
     self.templates.coerce = int
     if self.page:
         self.slug.data = page.slug
         self.title.data = page.title
         self.description.data = page.description
         self.content.data = page.content
         self.login_required.data = page.login_required
         self.show_in_nav.data = page.show_in_nav
         self.templates.data = page.template_id
         self.header_image.data = page.header_image
Ejemplo n.º 15
0
	def __init__(self, original_nickname, *args, **kwargs):
		Form.__init__(self, *args, **kwargs)
		self.original_nickname = original_nickname
Ejemplo n.º 16
0
 def __init__(self, *args, **kwargs):
     """Initialize the DownloadReportForm object"""
     Form.__init__(self, *args, **kwargs)
     self.start = None
     self.end = None
Ejemplo n.º 17
0
 def __init__(self, *args, **kwargs):
     """Initialize the SearchForm object"""
     Form.__init__(self, *args, **kwargs)
     self.reports = []
Ejemplo n.º 18
0
 def __init__(self, *args, **kwargs):
     """Initialize the registration form"""
     Form.__init__(self, *args, **kwargs)
     self.pw_reset = None
Ejemplo n.º 19
0
	def __init__(self, *args,**kwargs):
		Form.__init__(self,*args,**kwargs)
		self.access_token = None
		self.user = None
		self.validate()
Ejemplo n.º 20
0
 def __init__(self, *args, **kwargs):
     """Initialize the create chart form"""
     Form.__init__(self, *args, **kwargs)
     self.chart = None
Ejemplo n.º 21
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
Ejemplo n.º 22
0
 def __init__(self, default_license_id='CC BY-SA 3.0', default_language='en', **kwargs):
    kwargs.setdefault('license_choice', default_license_id)
    kwargs.setdefault('language', default_language)
    Form.__init__(self, **kwargs)
Ejemplo n.º 23
0
 def __init__(self, variant_choices):
     Form.__init__(self)
     self.variant_id.choices = variant_choices
Ejemplo n.º 24
0
 def __init__(self, type_choices):
     Form.__init__(self)
     self.type.choices = type_choices
 def __init__(self, *args, **kwargs):
     """Constructor. Not used???"""
     Form.__init__(self, *args, **kwargs)
     self.user = None
Ejemplo n.º 26
0
 def __init__(self, formdata=None, *a, **kw):
     if formdata is not None and not hasattr(formdata, 'getall'):
         formdata = MultiDict(formdata)
     BaseForm.__init__(self, formdata, *a, **kw)
Ejemplo n.º 27
0
 def __init__(self, *args, **kwargs):
     """Initialize the ChangeDateForm object"""
     Form.__init__(self, *args, **kwargs)
     self.ds = None
Ejemplo n.º 28
0
 def __init__(self, place, *a, **kw):
     Form.__init__(self, *a, **kw)
     self._place = place
     self._setup_booth_options()
Ejemplo n.º 29
0
 def __init__(self,*args,**kwargs):
     Form.__init__(self, *args, **kwargs)
     self.validate()
Ejemplo n.º 30
0
 def __init__(self, *args, **kwargs):
     """Initialize the submit report data form"""
     Form.__init__(self, *args, **kwargs)
     self.data_points = []
     self.stale_values = []
Ejemplo n.º 31
0
 def __init__(self, user_id, *args, **kwargs):
   """
   Store the original user_id to verify against to check uniqueness.
   """
   Form.__init__(self, *args, **kwargs) # originally: Form.__init__(self, *args, **kwargs):
   self.user_id = user_id
Ejemplo n.º 32
0
Archivo: forms.py Proyecto: opatut/mini
 def __init__(self, *args, **kwargs):
     self._form_name = type(self).__name__
     Form.__init__(self, *args, **kwargs)
Ejemplo n.º 33
0
 def __init__(self, place=None, *a, **kw):
     Form.__init__(self, *a, **kw)
     self._place = place
Ejemplo n.º 34
0
 def __init__(self, *args, **kwargs):
     """Initialize the form"""
     Form.__init__(self, *args, **kwargs)
Ejemplo n.º 35
0
 def __init__(self, formdata=None, *a, **kw):
     if formdata is not None and not hasattr(formdata, 'getall'):
         formdata = MultiDict(formdata)
     BaseForm.__init__(self, formdata, *a, **kw)
Ejemplo n.º 36
0
 def __init__(self):
     Form.__init__(self)
     self.widgets.choices = [(w.id, w.name) for w in Widget.query.all()]
Ejemplo n.º 37
0
 def __init__(self, default_email=None, **kwargs):
     kwargs.setdefault('contact_email', default_email)
     Form.__init__(self, **kwargs)
Ejemplo n.º 38
0
 def __init__(self, *args, **kwargs):
     """Initialize the registration form"""
     Form.__init__(self, *args, **kwargs)
     self.user = None
     self.allergies = None
Ejemplo n.º 39
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.date1 = None
     self.date2 = None
Ejemplo n.º 40
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.location.choices = [ (str(l.id), l.name) for l in labevents.database.Session().query(Location).all() ]
Ejemplo n.º 41
0
 def __init__(self, *args, **kwargs):
     """Initialize the edit report form"""
     Form.__init__(self, *args, **kwargs)
     self.report = None
Ejemplo n.º 42
0
 def __init__(self, place, *a, **kw):
     Form.__init__(self, *a, **kw)
     self._place = place
     self.ac.data = place.get_parent("AC").name
Ejemplo n.º 43
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     if 'post_id' in kwargs:
         self.post_id = kwargs['post_id']
     else:
         self.post_id = None
Ejemplo n.º 44
0
 def __init__(self, place, *a, **kw):
     Form.__init__(self, *a, **kw)
     self._place = place
     self._setup_booth_options()
Ejemplo n.º 45
0
 def __init__(self, data, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     if 'name' in data:
         self.name.data = data['name']
     if 'surname' in data:
         self.surname.data = data['surname']
Ejemplo n.º 46
0
    def __init__(self, ):
        Form.__init__(self)

        from sonic_app.app import app
        self.model.choices = [(m, m) for m in app.config.get('PI_MODELS')]
Ejemplo n.º 47
0
 def __init__(self):
     Form.__init__(self, csrf_enabled=True)
Ejemplo n.º 48
0
 def __init__(self, review_id=None, **kwargs):
     kwargs['review_id'] = review_id
     Form.__init__(self, **kwargs)
Ejemplo n.º 49
0
    def __init__(self, obj=None, prefix='', **kwargs):
        Form.__init__(self, obj=obj, prefix=prefix, **kwargs)

        self._obj = obj
Ejemplo n.º 50
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     if not self.next.data:
         self.next.data = get_redirect_target() or ''
Ejemplo n.º 51
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.user = None
Ejemplo n.º 52
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.name = None
Ejemplo n.º 53
0
 def __init__(self, original_nickname, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.original_nickname = original_nickname
Ejemplo n.º 54
0
	def __init__(self, *args, **kwargs):
		Form.__init__(self, *args, **kwargs)
Ejemplo n.º 55
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     if not self.next.data:
         self.next.data = get_redirect_target() or ''
Ejemplo n.º 56
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.user = None
Ejemplo n.º 57
0
 def __init__(self, place=None, *a, **kw):
     Form.__init__(self, *a, **kw)
     self._place = place