当前位置: 首页>>代码示例>>Python>>正文


Python Group.all方法代码示例

本文整理汇总了Python中models.Group.all方法的典型用法代码示例。如果您正苦于以下问题:Python Group.all方法的具体用法?Python Group.all怎么用?Python Group.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Group的用法示例。


在下文中一共展示了Group.all方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pending_join

# 需要导入模块: from models import Group [as 别名]
# 或者: from models.Group import all [as 别名]
 def pending_join(self):
     """Returns True if the user is pending approval to join a group."""
     for group in Group.all():
         for user in group.pending_users:
             if user.user_id() == self.user_id:
                 return True
     return False
开发者ID:DanAlbert,项目名称:app-hackathon,代码行数:9,代码来源:auth.py

示例2: getGroups

# 需要导入模块: from models import Group [as 别名]
# 或者: from models.Group import all [as 别名]
def getGroups(id):
	query = Group.all()
	if id:
		query = query.filter('parentGroup =', db.Key(id)) # XXX exceptions
	query.order('name')
	groups = []
	for g in query.fetch(1000):
		gg = g.json()
		try:
			gg['parent'] = g.parentGroup.key().__str__() if g.parentGroup else None
		except Exception:
			continue
		groups.append(gg)
	return groups
开发者ID:qwer,项目名称:schedule,代码行数:16,代码来源:views.py

示例3: get

# 需要导入模块: from models import Group [as 别名]
# 或者: from models.Group import all [as 别名]
 def get(self, username):
   if username == 'mine':
     user = User.get_current_user()
   else:
     user = get1_by_property(User, 'name', username)
   
   if user:
     balances = self.get_balances(user)
     self.generate('user_profile.html',
                   {'user':user,
                    'balances':balances,
                    'groups':Group.all(),
                    'vendors':Vendor.all()})    
   else:
     self.redirect('/oops/invalid_user')
开发者ID:tchaikov,项目名称:beanfs,代码行数:17,代码来源:user.py

示例4: __init__

# 需要导入模块: from models import Group [as 别名]
# 或者: from models.Group import all [as 别名]
    def __init__(self, parent, *args, **kwargs):
        QDialog.__init__(self, parent, *args, **kwargs)

        vbox = QVBoxLayout()
        vbox.addWidget(FBoxTitle(u"<h3>Ajout de contact </h3>"))
        self.combo_grp = QComboBox()
        groups = Group()
        groups.name = "Aucun"

        self.list_grp = Group.all()
        self.list_grp.append(groups)
        self.list_grp.reverse()

        for index in self.list_grp:
            sentence = u"%(name)s" % {'name': index.name}
            self.combo_grp.addItem(sentence)

        self.full_name = LineEdit()
        self.msg_e_or_c = FLabel("")
        self.full_name.setFont(QFont("Arial", 16))
        self.phone_number = IntLineEdit()
        self.phone_number.setInputMask("D9.99.99.99")
        self.phone_number.setAlignment(Qt.AlignCenter)
        self.phone_number.setFont(QFont("Arial", 16))

        send_butt = Button(u"Enregistrer")
        send_butt.clicked.connect(self.save_form)
        cancel_but = Button(u"Fermer")
        cancel_but.clicked.connect(self.cancel)

        formbox = QGridLayout()
        formbox.addWidget(FLabel(u"Groupes:"), 0, 0)
        formbox.addWidget(self.combo_grp, 1, 0)
        formbox.addWidget(FLabel(u"Nom complèt: "), 0, 1)
        formbox.addWidget(self.full_name, 1, 1)
        formbox.addWidget(FLabel(u"Numéro: "), 0, 2)
        formbox.addWidget(self.phone_number, 1, 2)
        formbox.addWidget(send_butt, 2, 1)
        formbox.addWidget(cancel_but, 2, 0)
        formbox.addWidget(self.msg_e_or_c, 3, 0, 3, 2)

        vbox.addLayout(formbox)
        self.setLayout(vbox)
开发者ID:fadiga,项目名称:waritchi,代码行数:45,代码来源:contact_add.py

示例5: post

# 需要导入模块: from models import Group [as 别名]
# 或者: from models.Group import all [as 别名]
  def post(self):
    data = UserForm(data=self.request.POST)

    logging.info(self.request.POST)
    
    if not data.is_valid():
      self.redirect('/u/register')
    else:
      user = data.save(commit=False)

      if not exists_by_property(User, 'name', user.name):
        user.who = users.get_current_user()
        user.put()
        for group in self.request.POST.getall('group'):
          user.join(Group.get_by_id(group))
        self.redirect('/u/%s/profile' % user.name)
      else:
        logging.debug('user %s already exists!' % user.name)
        self.generate('add_user.html',
                      {'form':data,
                       'groups':Group.all()})
开发者ID:tchaikov,项目名称:beanfs,代码行数:23,代码来源:user.py

示例6: get

# 需要导入模块: from models import Group [as 别名]
# 或者: from models.Group import all [as 别名]
 def get(self):
     """Displays a list of all groups."""
     return self.render('groups_list', {'groups': Group.all()})
开发者ID:ryleyherrington,项目名称:app_hackathon,代码行数:5,代码来源:main.py

示例7: group

# 需要导入模块: from models import Group [as 别名]
# 或者: from models.Group import all [as 别名]
 def group(self):
     """The group the user belongs to, or None."""
     for group in Group.all():
         if self.gae_user in group.members:
             return group
     return None
开发者ID:DanAlbert,项目名称:app-hackathon,代码行数:8,代码来源:auth.py

示例8: get

# 需要导入模块: from models import Group [as 别名]
# 或者: from models.Group import all [as 别名]
 def get(self):
     return self.render('groups_list', { 'groups': Group.all() })
开发者ID:DanAlbert,项目名称:d20mgr,代码行数:4,代码来源:back.main.py

示例9: get

# 需要导入模块: from models import Group [as 别名]
# 或者: from models.Group import all [as 别名]
 def get(self):
   self.generate("list_group.html",
                 {"groups":list(Group.all())})
开发者ID:tchaikov,项目名称:beanfs,代码行数:5,代码来源:group.py


注:本文中的models.Group.all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。