示例#1
0
文件: forms.py 项目: nocko/cfmi
 def __init__(self, *args, **kwargs):
     print MailingList.query.all()
     Form.__init__(self, *args, **kwargs)
     subscribed = MailingList.query.filter(or_(
             MailingList.restricted==False, 
             MailingList.users.contains(g.user)))
     self.lists.query = subscribed
示例#2
0
文件: forms.py 项目: Red54/Sophia
 def __init__(self, user, topic, attachments=None, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.user = user
     self.topic = topic
     if not attachments:
         attachments = []
     self.attachments = attachments
示例#3
0
文件: forms.py 项目: Red54/Sophia
 def __init__(self, user, project, attachments=None, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.user = user
     self.project = project
     if not attachments:
         attachments = []
     self.attachments = attachments
示例#4
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     DEFAULT_RED = kwargs.get('red', 0)
     DEFAULT_GREEN = kwargs.get('green', 0)
     DEFAULT_BLUE = kwargs.get('blue', 0)
     # DEFAULT_COLOR = Color(rgb=(DEFAULT_RED, DEFAULT_GREEN, DEFAULT_BLUE))
     print("RGBForm: color:%s,%s,%s" % (DEFAULT_RED, DEFAULT_GREEN, DEFAULT_BLUE))
示例#5
0
    def user_delete(username):
        title = "Delete user"

        if not ldap_user_exists(username=username):
            abort(404)

        form = Form(request.form)

        if form.validate_on_submit():
            try:
                user = ldap_get_user(username=username)
                ldap_delete_entry(user['distinguishedName'])
                flash("User successfuly deleted.", "success")
                return redirect(url_for('core_index'))
            except ldap.LDAPError as e:
                error = e.message['info'].split(":", 2)[-1].strip()
                error = str(error[0].upper() + error[1:])
                flash(error, "error")
        elif form.errors:
                flash("Some fields failed validation.", "error")

        return render_template("pages/user_delete.html", title=title,
                               action="Delete user", form=form,
                               username=username,
                               parent=url_for('user_overview',
                                              username=username))
示例#6
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.mess.choices = db.session.query(Kontrol.mes_id.distinct(), Kontrol.message).order_by(Kontrol.message).all()
     self.objs.choices = db.session.query(Kontrol.obj_id.distinct(), Kontrol.object).order_by(Kontrol.object).all()
     # self.category.choices = db.session.query(Kontrol.category.distinct(), Kontrol.category).order_by(
     #     Kontrol.category).all()
     self.mess.choices.insert(0, (0, u'Все'))
     self.objs.choices.insert(0, (0, u'Все'))
示例#7
0
 def __init__(self, *args, **kwargs):
     """
     Retrieve a user object from a User class using a YubiKey token
     @param args: Arguments, in order of definition in class
     @param kwargs: Keyword based Arguments, in any order
     """
     Form.__init__(self, *args, **kwargs)
     self.user = None
示例#8
0
 def __init__(self, post, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.title.data = post.title
     self.body.data = post.body
     self.image_url.data = post.image_url
     self.slug.data = post.slug
     self.category_id.data = post.category_id
     self.category_id.choices = Category.get_list()
示例#9
0
 def __init__(self, *args, **kwargs):
     """
     Change the password of a user object via a User class helper
     @param args: Arguments, in order of definition in class
     @param kwargs: Keyword based Arguments, in any order
     """
     Form.__init__(self, *args, **kwargs)
     self.user = None
示例#10
0
 def __init__(self, *args, **kwargs):
     """
     Register a new a Chat object via a Chat class helper
     @param args: Arguments, in order of definition in class
     @param kwargs: Keyword based Arguments, in any order
     """
     Form.__init__(self, *args, **kwargs)
     self.channel = None
示例#11
0
  def __init__(self, original_nickname, *args, **kwargs):
    """
    Constructor

    Args:
      original_nickname: the original nickname which is to be shown
    """
    Form.__init__(self, *args, **kwargs)
    self.original_nickname = original_nickname
示例#12
0
    def __init__(self, user=None, author=None, feed_id=None, *args, **kwargs):
        Form.__init__(self, *args, **kwargs)

        self.feeds.choices = [(f.id, f.name ) for f in user.feeds]
        if feed_id is not None:
            self.feeds.data = [feed_id]

        self.similar_authors.choices = [(a.id,  a.__repr__()) for a in author.similar_authors()]
        self.similar_authors.choices.insert(0, (author.id, str(author)))
示例#13
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     if 'subscription' in kwargs:
         self.subscription = kwargs['subscription']
         # if self.subscription is not None:
         # self.enable_email.data = self.subscription.enable_email
         #     self.email_frequency.data = self.subscription.email_frequency
     else:
         self.subscription = None
示例#14
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     DEFAULT_RED = kwargs.get('red', 0)
     DEFAULT_GREEN = kwargs.get('green', 0)
     DEFAULT_BLUE = kwargs.get('blue', 0)
     DEFAULT_PERIOD = kwargs.get('period', 100)
     DEFAULT_MODE = kwargs.get('colormode', 0)
     print("SnakeForm: bgcolor:%s,%s,%s period:%s mode:%s" %
           (DEFAULT_RED, DEFAULT_GREEN, DEFAULT_BLUE, DEFAULT_PERIOD, DEFAULT_MODE))
示例#15
0
文件: forms.py 项目: nocko/cfmi
 def __init__(self,  *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.project.query = Project.query.order_by(Project.name)
     if 'obj' in kwargs:
         self.id.data = kwargs['obj'].id
         self.subject.query = Subject.query.filter(Subject.project==kwargs['obj'].project)
     else:
         self.subject.query = Subject.query
     self.subject.query = self.subject.query.order_by(Subject.name)
示例#16
0
 def __init__(self, *args, **kwargs):
     images = []
     try:
         album = kwargs['obj']
         images = album.images
     except KeyError:
         pass
     Form.__init__(self, *args, **kwargs)
     self.coverImageId.choices = [(image.id, image.id) for image in images]
示例#17
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.container.choices = [("0", "None")]
     self.container.choices.extend(
         [(str(item['Id']), item['Name']) for item in lsmsd_api.get_items()]
     )
     self.usage.choices.extend(
         [i.value for i in list(UsagePolicy)]
     )
    def __init__(self, *args, **kwargs):
        Form.__init__(self, *args, **kwargs)

        # Set hidden data
        if not self.originator_type.data and originator_type is not None:
            self.originator_type.data = originator_type
        if not self.originator_id.data and originator_id is not None:
            self.originator_id.data = originator_id
        if not self.next.data:
            self.next.data = get_redirect_target() or ''
示例#19
0
	def __init__(self, user, *args, **kwargs):
		Form.__init__(self, *args, **kwargs)
		self.email.data = user.email
		self.name.data = user.name
		self.nickname.data = user.nickname
		self.role.data = unicode(user.role)
		self.address.data = user.address
		self.phone.data = user.phone
		self.timezone.data = user.timezone
		self.lang.data = user.lang
def delete(shelter_id):
    shelter = Shelter.query.filter_by(id=shelter_id).one()
    form = Form()

    if form.validate_on_submit():
        db.session.delete(shelter)
        db.session.commit()
        flash(shelter.name + " was deleted from the database.")
        return redirect(url_for("shelters.list_all"))

    return render_template("shelters/delete.jinja2", form=form, shelter=shelter)
示例#21
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.choice_list1.choices = self.choice_list2.choices = self.choice_list3.choices = [
             (u'', u'---------'),
             (u'本系推研', u'本系推研'),
             (u'本系直博', u'本系直博'),
             (u'出国', u'出国'),
             (u'深研院', u'深研院'),
             (u'外系推研', u'外系推研'),
             (u'外校推研', u'外校推研'),
             (u'其它', u'其它')]
def delete(puppy_id):
    puppy = Puppy.query.filter_by(id=puppy_id).one()
    # we can use a generic form, since there are no fields
    form = Form()

    if form.validate_on_submit():
        db.session.delete(puppy)
        db.session.commit()
        flash(puppy.name + " was put to sleep.")
        return redirect(url_for("puppies.list_all"))

    return render_template("puppies/delete.jinja2", form=form, puppy=puppy)
示例#23
0
def logout():
    form = Form()
    if form.validate_on_submit():
        logout_user()
        if 'redirect_to' in session:
            redirect_to = session['redirect_to']
            session.pop('redirect_to', None)
        flash(gettext('Signed out successfully.'))
    else:
        flash(gettext('Invalid Action'), 'error')

    return redirect(url_for('index'))
def delete(adopter_id):
    adopter = Adopter.query.filter_by(id=adopter_id).one()
    # we can use a generic form, since there are no fields
    form = Form()

    if form.validate_on_submit():
        db.session.delete(adopter)
        db.session.commit()
        flash(adopter.name + " was deleted from the database.")
        return redirect(url_for("adopters.list_all"))

    return render_template("adopters/delete.jinja2", form=form, adopter=adopter)
示例#25
0
文件: forms.py 项目: Red54/Sophia
 def __init__(self, user, todo, attachments=None, *args, **kwargs):
     """
     class init
     :param user:
     :param todo:
     :param attachment:
     :param args:
     :param kwargs:
     """
     if not attachments:
         attachments = []
     Form.__init__(self, *args, **kwargs)
     self.user = user
     self.todo = todo
     self.attachments = attachments
示例#26
0
	def validate(self):
		"""
		Validaion of the form, checking user password hash with stored one.
		:return: True if the form is correct and the user as given correct credentials, 
		False otherwise
		"""
		cust_logger.info("Trying to validate form")

		rv = Form.validate(self)
		if not rv:
			return False

		user = User.objects(username=self.username.data.lower()).first()
		if user is None:
			cust_logger.info("Invalid username entered")
			self.password.errors.append('Unknown username or password')
			return False

		if not user.check_password(self.password.data):
			cust_logger.info("Invalid password entered")
			self.password.errors.append('Unknown username or password')
			return False

		self.user = user
		return True
示例#27
0
    def validate(self):
        rv = Form.validate(self)
        if not rv:
            print 'not OK'
            return False

        return True
示例#28
0
    def validate(self, regCode):
        rv = Form.validate(self)
        if not rv:
           return False

        # check if user has given valid lol id
        summonerid = self.bslol.getSummonerId(self.summonername.data)
        if summonerid == None:
            self.summonername.errors.append("You've entered and invalid summoner id")
            return False

        # check if user has givne a valid twitter id

        # FIX: we must send reg_code to the dm
        twtRetCode = self.bstwt.sendDM(self.twtid.data, regCode)
        if twtRetCode != 0:
            if twtRetCode == 34: # error code 34: twitter user does not exist
                self.twtid.errors.append("You've entered an invalid Twitter ID!")
                return False
            elif twtRetCode == 150: # error code 150: not following us
                self.twtid.errors.append('To verify your Twitter account, we need to send you a direct message. Follow @bsbot_lol now!')
                return False
            else:
                self.twtid.errors.append('Error connecting to Twitter :(')
                return False

        return True
示例#29
0
 def validate(self):
     rv = Form.validate(self)
     username = self.username.data
     password = self.password.data
     
     if not rv:
         # invalid information
         self.username.errors.append('Something gone wrong')
         return False
     
     if not User.check_username(username):
         # user does NOT exist
         self.username.errors.append('Invalid username and/or password')
         return False
     
     if not User.check_password(username, password):
         # incorrect password
         self.password.errors.append('Invalid username and/or password')
         return False
     
     user = User(username=username)
     
     if user is None:
         # user could not create for some reason
         self.username.errors.append('Invalid username and/or password')
         return False
     
     self.user = user
     return True
示例#30
0
文件: forms.py 项目: TZilla/HydroPi
    def validate(self):
        
        if not Form.validate(self):
            return False
        valid=True #assume success
        email = mongo.db.users.find({'email':self.email.data.lower()}).count()
        username = mongo.db.users.find({'username':self.username.data.lower()}).count()

        if email>0:
            self.email.errors.append("That email is already taken")
            valid=False
        if username>0:
            self.username.errors.append("That username is already taken")
            valid=False
        if(len(self.password.data)<8):
            self.password.errors.append("Passwords must be at least 8 characters long")
            self.password1.errors.append("")
            valid=False
        else:
            self.salt = uuid.uuid4().bytes
            self.password.data = hashlib.sha512(self.password.data.encode('utf-8') + self.salt).digest()
            self.password1.data = hashlib.sha512(self.password1.data.encode('utf-8') + self.salt).digest()
        if(self.password.data!=self.password1.data):
            self.password.errors.append("The passwords do not match")
            self.password1.errors.append("")
            valid=False
        return valid
示例#31
0
    def validate(self):
        outcome = True

        rv = Form.validate(self)
        if not rv:
            outcome = False

        if self.name.data == '':
            self.name.errors.append('Campo obbligatorio')
            outcome = False

        if self.surname.data == '':
            self.surname.errors.append('Campo obbligatorio')
            outcome = False

        if self.mail.data == '':
            self.mail.errors.append('Campo obbligatorio')
            outcome = False
        else:
            mail = User.query.filter_by(email=self.mail.data).first()
            if mail is not None:
                self.mail.errors.append(
                    'E-Mail presente in database, inserirne una differente')
                outcome = False

        found = False
        for v, _ in self.goal.choices:
            if self.goal.data == v:
                found = True
                break

        if found == False:
            del self.goal.errors[:]
            self.goal.errors.append('Seleziona una destinazione')

        return outcome
示例#32
0
文件: forms.py 项目: gnkr8/feedback
 def __init__(self, *args, **kwargs):
   Form.__init__(self, *args, **kwargs)
   self.project = None
示例#33
0
文件: forms.py 项目: gnkr8/feedback
  def validate(self):
    rs = Form.validate(self)

    return rs
示例#34
0
 def __init__(self, original_role, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.the_original_id = ""
     print ' . . . . . . . . . . . . . . .' + str(original_role.id)
     if original_role.id is not None:
         self.the_original_id = original_role.id.upper()
示例#35
0
 def validate(self):
     if not Form.validate(self):
         return False
     return True
示例#36
0
 def __init__(self, *args, **kwargs):
     kwargs['csrf_enabled'] = False
     Form.__init__(self, *args, **kwargs)
示例#37
0
    def validate(self):
        rv = Form.validate(self)
        if not rv:
            return False

        validate_email = True
        validate_name = True
        validate_twitter = True

        if self.twitter.data and '@' in self.twitter.data:
            self.twitter.data = self.twitter.data.replace('@', '')

        name = self.name.data
        email = self.email.data
        twitter = self.twitter.data

        current_name = current_user.name
        current_email = current_user.email
        current_twitter = current_user.twitter_handle


        if email == current_email:
            validate_email = False
        if name == current_name:
            validate_name = False
        if twitter == current_twitter:
            validate_twitter = False

        if not re.match("^[a-zA-Z0-9_-]+$", name):
            self.name.errors.append('Only letters, digits, dashes, underscores allowed')
            return False

        if not re.search("[a-zA-Z0-9]", name):
            self.name.errors.append('Must have at least one letter or number')
            return False

        if not NAME_LEN_MIN < len(name) + 1 < NAME_LEN_MAX:
            self.name.errors.append('Must be between %s and %s characters'% (NAME_LEN_MIN,NAME_LEN_MAX)) 
            return False

        if name.lower() in ILLEGAL_NAMES:
            self.name.errors.append('Name not allowed. Please try another.')
            self.name.data = ''
            return False

        user = User.find_user_by_name(name).first()
        if validate_name and user is not None:
            name = User.make_unique_name(name)
            self.name.errors.append('Name already taken, perhaps %s suits you?' % name)
            self.name.data = name
            return False
        
        if validate_email and self.email.data and self.email.validate(self.email.data):
            user = User.find_user_by_email(self.email.data).first()
            if user is not None:
                self.email.errors.append('Email address already used')
                return False

        if validate_twitter and self.twitter.data:
            user = User.find_user_by_twitter(self.twitter.data).first()
            if user is not None:
                self.twitter.errors.append('Twitter username already used')
                return False

        return True
示例#38
0
def userlist(page=1, pending=False, sponsored=False, rolloffs=False):
    # We need to make sure sponsors without admin/labstaff permissions don't go
    # browsing through all the users data
    domains = g.user.get_domains()
    if ((sponsored and 'sponsor' not in domains) or
        (not sponsored and (not g.user_is_labstaff) and (not g.user_is_admin))
            or (rolloffs and (not g.user_is_labstaff) and
                (not g.user_is_admin))):
        flash("Unauthorized.")
        return redirect('index')
    if (pending or rolloffs) and request.method == "POST":
        form = Form(request.form)
        if not form.validate():
            flash("There was an error with your submission.")
            redirect(request.url)
        users = [
            user for user, value in request.form.iteritems()
            if value == 'approve'
        ]
        if rolloffs:
            users = [user for user, value in request.form.iteritems()]
        users = [User.username == user for user in users]
        if len(users) > 0:
            query = User.query.filter(or_(*users))
            if sponsored:
                # Filter and make sure we only get this sponsors users, for security
                query = query.filter(User.sponsor == g.user.username)
            users = query.all()
            for user in users:
                if sponsored:
                    user.status = 'pending_labstaff'
                elif rolloffs:
                    user.status = 'pending_rolloff'
                else:
                    user.status = 'pending_create'
                db.session.add(user)
            db.session.commit()
        # here we handle denying accounts:
        users = [
            user for user, value in request.form.iteritems() if value == 'deny'
        ]
        users = [User.username == user for user in users]
        if len(users) > 0:
            query = User.query.filter(or_(*users))
            if sponsored:
                query = query.filter(User.sponsor == g.user.username)
            users = query.all()
            for user in users:
                # send rejection emails, silent reject if comments are empty
                if sponsored:
                    mail.sponsor_reject(user)
                elif g.user_is_admin:
                    mail.admin_reject(user)
                # drop rejected users
                db.session.delete(user)
            db.session.commit()

    query = User.query
    sort = 'username'
    sort_col = User.username
    sort_dir = asc
    cols = {
        'username': User.username,
        'uid': User._uid,
        'sponsor': User.sponsor,
        'email': User.email,
        'name': User.last_name,
        'last_name': User.last_name,
        'first_name': User.first_name,
        'status': User.status,
        'grad_date': User._grad_date
    }

    # Let's make the filter form
    class FilterForm(Form):
        pass

    for field, col in cols.iteritems():
        setattr(FilterForm, field, TextField())
    filter_form = FilterForm(request.args)

    if 'sort' in request.args:
        if request.args['sort'] in cols:
            sort = request.args['sort']
            sort_col = cols[request.args['sort']]
    if 'dir' in request.args and request.args['dir'] == 'desc':
        sort_dir = desc

    if sponsored:
        query = query.filter(User.sponsor == g.user.username)
        if pending:
            query = query.filter(User.status == 'pending_sponsor')
        else:
            query = query.filter(User.status != 'pending_sponsor')
    elif rolloffs:
        now = date.today()
        query = query.filter(User._grad_date <= now)
        query = query.filter(User.status != 'pending_sponsor')
        query = query.filter(User.status != 'pending_labstaff')
        query = query.filter(User.status != 'pending_rolloff')
    else:
        if pending:
            query = query.filter(User.status == 'pending_labstaff')


#        else:
#            query = query.filter(User.status != 'pending_labstaff')
#            query = query.filter(User.status != 'pending_sponsor')
    for field, col in cols.iteritems():
        if field in request.args:
            if request.args[field].strip() == "":
                continue
            query = query.filter(col.like(request.args[field].strip()))
    query = query.order_by(sort_dir(sort_col))
    page = query.paginate(page)
    if pending:
        # Patch a Form. This allows us to keep our CSRF protection
        class F(Form):
            pass

        for user in page.items:
            setattr(
                F, user.username,
                RadioField(choices=[('approve', 'Approve'),
                                    ('postpone', 'Postpone'),
                                    ('deny', 'Deny')],
                           validators=[validators.Required()]))
        # Flask-WTForms likes to pull data from request.form. Force it not to.
        form = F(ImmutableMultiDict())
        # We do this after the fact so WTForms can do some of its binding
        for user in page.items:
            user.radio = getattr(form, user.username)
            user.radio.data = 'postpone'
        if sponsored:
            template = 'sponsorship_requests.html'
        else:
            template = 'list_pending_users.html'
    elif rolloffs:

        class rolloffCheckbox(Form):
            pass

        for user in page.items:
            setattr(rolloffCheckbox, user.username, BooleanField())
        form = rolloffCheckbox(ImmutableMultiDict())
        for user in page.items:
            user.checkbox = getattr(form, user.username)
        template = 'list_upcoming_rolloffs.html'
    else:
        form = Form()
        if sponsored:
            template = 'sponsored_users.html'
        else:
            template = 'userlist.html'
    return render_template(template,
                           page=page,
                           sort=sort,
                           sort_dir='asc' if sort_dir == asc else 'desc',
                           form=form,
                           filter_form=filter_form)
示例#39
0
 def validate(self):
     if not Form.validate(self):
         return False
     if not self.by_title.data and not self.by_author.data:
         return False
     return True
示例#40
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.container.choices = [("0", "None")]
     self.container.choices.extend([(str(item['Id']), item['Name'])
                                    for item in lsmsd_api.get_items()])
示例#41
0
 def __init__(self, lease, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     if lease is not None:
         self.the_official_id = lease.official_id
示例#42
0
 def __init__(self, user, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.original_username = user.username
     self.original_email = user.email
示例#43
0
 def validate(self):
     return Form.validate(self)
示例#44
0
 def __init__(self, **kwargs):
     self.edit = kwargs.get("edit", False)
     Form.__init__(self, **kwargs)
示例#45
0
 def validate(self):
     if Form.validate(self):
         if not User.query.filter_by(
                 username=self.username.data.lower()).count():
             return True
     return False
示例#46
0
	def __init__(self, stored_file, *args, **kwargs):
		Form.__init__(self, *args, **kwargs)
		self.stored_file = stored_file
示例#47
0
 def validate(self):
     if Form.validate(self):
         username = self.username.data
         password = self.password.data
         self.user = User.check_auth(username, password)
     return self.user is not None
示例#48
0
 def __init__(self, user, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.original_nickname = user.nickname
示例#49
0
 def __init__(self, suggest=True, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     if suggest:
         self.addSuggestions()
示例#50
0
def get_csrf_headers():
    form = Form()
    return {'X-CSRF-Token': form.csrf_token._value()}
示例#51
0
文件: forms.py 项目: deveshj4/tol
 def validate(self):
     rv = Form.validate(self)
     if not rv:
         return False
     return True
示例#52
0
文件: forms.py 项目: RalfJung/dudel
 def __init__(self, *args, **kwargs):
     self._form_name = type(self).__name__
     Form.__init__(self, *args, **kwargs)
示例#53
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.user = None
示例#54
0
文件: forms.py 项目: RalfJung/dudel
 def is_submitted(self):
     return Form.is_submitted(self) and request.form.get(
         "form_name") == self._form_name
示例#55
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     if not self.next.data:
         self.next.data = get_redirect_target() or ''
示例#56
0
文件: forms.py 项目: RalfJung/dudel
 def hidden_tag(self, *args, **kwargs):
     self.form_name.data = self._form_name
     return Form.hidden_tag(self, *args, **kwargs)
示例#57
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
示例#58
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.item = None
示例#59
0
 def __init__(self, original_nickname, *args, **kwargs):
     Form.__init__(self, *args, **kwargs)
     self.original_nickname = original_nickname
示例#60
0
 def __init__(self, *args, **kwargs):
     Form.__init__(self)
     self.metas.choices = [(meta.meta_id, meta.meta_name) for meta in Meta.query.order_by('meta_name')]