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


Python Registration.find方法代码示例

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


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

示例1: get_registrations_with_tickets

# 需要导入模块: from indico.modules.events.registration.models.registrations import Registration [as 别名]
# 或者: from indico.modules.events.registration.models.registrations.Registration import find [as 别名]
def get_registrations_with_tickets(user, event):
    return Registration.find(Registration.user == user,
                             Registration.state == RegistrationState.complete,
                             RegistrationForm.event_id == event.id,
                             RegistrationForm.tickets_enabled,
                             RegistrationForm.ticket_on_event_page,
                             ~RegistrationForm.is_deleted,
                             ~Registration.is_deleted,
                             _join=Registration.registration_form).all()
开发者ID:belokop,项目名称:indico_bare,代码行数:11,代码来源:util.py

示例2: _checkParams

# 需要导入模块: from indico.modules.events.registration.models.registrations import Registration [as 别名]
# 或者: from indico.modules.events.registration.models.registrations.Registration import find [as 别名]
 def _checkParams(self, params):
     RHManageRegFormBase._checkParams(self, params)
     ids = set(request.form.getlist("registration_id"))
     self.registrations = (
         Registration.find(Registration.id.in_(ids), ~Registration.is_deleted)
         .with_parent(self.regform)
         .order_by(*Registration.order_by_name)
         .all()
     )
开发者ID:florv,项目名称:indico,代码行数:11,代码来源:reglists.py

示例3: _visible_registration

# 需要导入模块: from indico.modules.events.registration.models.registrations import Registration [as 别名]
# 或者: from indico.modules.events.registration.models.registrations.Registration import find [as 别名]
 def _visible_registration(event):
     if not event.has_feature('registration'):
         return False
     if RegistrationForm.find(RegistrationForm.is_scheduled, RegistrationForm.event_id == int(event.id)).count():
         return True
     if not session.user:
         return False
     return bool(Registration.find(Registration.user == session.user,
                                   Registration.event_id == int(event.id),
                                   ~Registration.is_deleted,
                                   ~RegistrationForm.is_deleted,
                                   _join=Registration.registration_form).count())
开发者ID:fph,项目名称:indico,代码行数:14,代码来源:__init__.py

示例4: _process

# 需要导入模块: from indico.modules.events.registration.models.registrations import Registration [as 别名]
# 或者: from indico.modules.events.registration.models.registrations.Registration import find [as 别名]
 def _process(self):
     regforms = RegistrationForm.find_all(
         RegistrationForm.publish_registrations_enabled, event_id=int(self.event.id)
     )
     query = Registration.find(
         Registration.event_id == self.event.id,
         RegistrationForm.publish_registrations_enabled,
         ~RegistrationForm.is_deleted,
         ~Registration.is_deleted,
         _join=Registration.registration_form,
     ).order_by(db.func.lower(Registration.last_name), db.func.lower(Registration.first_name))
     registrations = [(reg.get_full_name(), reg.get_personal_data()) for reg in query]
     return self.view_class.render_template(
         "display/participant_list.html",
         self.event,
         event=self.event,
         regforms=regforms,
         show_affiliation=any(pd.get("affiliation") for reg, pd in registrations),
         show_position=any(pd.get("position") for reg, pd in registrations),
         registrations=registrations,
     )
开发者ID:hennogous,项目名称:indico,代码行数:23,代码来源:display.py

示例5: _associate_registrations

# 需要导入模块: from indico.modules.events.registration.models.registrations import Registration [as 别名]
# 或者: from indico.modules.events.registration.models.registrations.Registration import find [as 别名]
def _associate_registrations(user, **kwargs):
    from indico.modules.events.registration.models.registrations import Registration

    reg_alias = db.aliased(Registration)
    subquery = db.session.query(reg_alias).filter(
        reg_alias.user_id == user.id,
        reg_alias.registration_form_id == Registration.registration_form_id,
        ~reg_alias.is_deleted,
    )
    registrations = (
        Registration.find(
            Registration.user_id == None,  # noqa
            Registration.email.in_(user.all_emails),
            ~subquery.exists(),
            ~Registration.is_deleted,
        )
        .order_by(Registration.submitted_dt.desc())
        .all()
    )
    if not registrations:
        return
    done = set()
    for registration in registrations:
        if registration.registration_form_id in done:
            continue
        logger.info("Associating %s with %s", registration, user)
        registration.user = user
        done.add(registration.registration_form_id)
    db.session.flush()
    num = len(done)
    flash(
        ngettext(
            "A registration has been linked to your account.",
            "{n} registrations have been linked to your account.",
            num,
        ).format(n=num),
        "info",
    )
开发者ID:MichelCordeiro,项目名称:indico,代码行数:40,代码来源:__init__.py

示例6: validate_email

# 需要导入模块: from indico.modules.events.registration.models.registrations import Registration [as 别名]
# 或者: from indico.modules.events.registration.models.registrations.Registration import find [as 别名]
 def validate_email(self, field):
     if RegistrationInvitation.find(email=field.data).with_parent(self.regform).count():
         raise ValidationError(_("There is already an invitation with this email address."))
     if Registration.find(email=field.data, is_active=True).with_parent(self.regform).count():
         raise ValidationError(_("There is already a registration with this email address."))
开发者ID:oddlord,项目名称:indico,代码行数:7,代码来源:forms.py


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