Exemplo n.º 1
0
 def save_changes(self, category):
     forms.set_fields(category, self.data, 'name', 'ordering')
     if self.data['ordering'] is None:
         category.ordering = Category.query.count()-1
     else:
         category.ordering = self.data['ordering']
     if category.ordering < 0:
         category.ordering = 0
     db.commit()
Exemplo n.º 2
0
 def save_changes(self, forum):
     forms.set_fields(forum, self.data, 'category', 'name',
                      'allow_anonymous', 'description', 'is_public')
     if self.data['ordering'] is None:
         forum.ordering = self['category'].forums.count()-1
     else:
         forum.ordering = self.data['ordering']
     if forum.ordering < 0:
         forum.ordering = 0
     db.commit()
Exemplo n.º 3
0
 def _set_common_attributes(self, war):
     FightUsForm._set_common_attributes(self, war)
     forms.set_fields(war, self.data, 'orgamember', 'status')
     newmap_id =  self.data['newmap']
     if newmap_id != -1:
         newmap = WarMap.query.get(newmap_id)
         if newmap is not None:
             war.maps.append(newmap)
     newmember_id =  self.data['newmember']
     if newmember_id != -1:
         newmember = User.query.get(newmember_id)
         if newmember is not None:
             war.memberstatus[newmember] = self.data['newmemberstatus']
Exemplo n.º 4
0
 def _set_common_attributes(self, user):
     forms.set_fields(
         user,
         self.data,
         "www",
         "real_name",
         "birthday",
         "display_name",
         "height",
         "address",
         "zip",
         "city",
         "country",
         "username",
         "email",
         "notes",
         "userpictype",
     )
Exemplo n.º 5
0
 def _set_common_attributes(self, entry):
     forms.set_fields(entry, self.data, 'text')
Exemplo n.º 6
0
 def _set_common_attributes(self, level):
     forms.set_fields(level, self.data, 'ordering')
     if self.data['ordering'] is None:
         level.ordering = Level.query.count()-1
     else:
         level.ordering = self.data['ordering']
Exemplo n.º 7
0
 def _set_common_attributes(self, squad):
     squad.game = self.data['game']
     forms.set_fields(squad, self.data)
Exemplo n.º 8
0
 def _set_common_attributes(self, news):
     forms.set_fields(news, self.data, "title", "text", "status", "pub_date")
Exemplo n.º 9
0
 def save_changes(self, post):
     forms.set_fields(post, self.data, 'text')
     db.commit()
Exemplo n.º 10
0
 def _set_common_attributes(self, imaccount):
     imaccount.user = self.user if self.user else User.query.get(self.data["username"])
     forms.set_fields(imaccount, self.data, "service", "account")
Exemplo n.º 11
0
 def _set_common_attributes(self, group):
     forms.set_fields(group, self.data)
     bind_privileges(group.privileges, self.data["privileges"])
Exemplo n.º 12
0
 def _set_common_attributes(self, war):
     forms.set_fields(war, self.data, 'clanname', 'date', 'server',
                      'mode', 'playerchangecount', 'contact',
                      'notes', 'squad', 'clanhomepage', 'clantag',
                      'status')
Exemplo n.º 13
0
 def _set_common_attributes(self, warmode):
     forms.set_fields(warmode, self.data, 'free1', 'free2', 'free3')
     warmode.name = self.data['modename']
     warmode.game = Game.query.get(self.data['game'])
Exemplo n.º 14
0
 def _set_common_attributes(self, warresult):
     forms.set_fields(warresult, self.data, 'our_points', 'enemy_points', 'comment')
     self.war.status = self.data['status']