Example #1
0
 def _process_args(self, all_selected, event_ids):
     RHManageCategoryBase._process_args(self)
     query = (Event.query.with_parent(self.category).order_by(
         Event.start_dt.desc()))
     if not all_selected:
         query = query.filter(Event.id.in_(event_ids))
     self.events = query.all()
Example #2
0
 def _process_args(self):
     RHManageCategoryBase._process_args(self)
     query = (Event.query.with_parent(self.category).order_by(
         Event.start_dt.desc()))
     if request.form.get('all_selected') != '1':
         query = query.filter(
             Event.id.in_(map(int, request.form.getlist('event_id'))))
     self.events = query.all()
Example #3
0
 def _process_args(self):
     RHManageCategoryBase._process_args(self)
     query = (Event.query
              .with_parent(self.category)
              .order_by(Event.start_dt.desc()))
     if request.form.get('all_selected') != '1':
         query = query.filter(Event.id.in_(map(int, request.form.getlist('event_id'))))
     self.events = query.all()
Example #4
0
 def _process_args(self):
     RHManageCategoryBase._process_args(self)
     target_category_id = request.form.get('target_category_id')
     if target_category_id is None:
         self.target_category = None
     else:
         self.target_category = Category.get_one(int(target_category_id), is_deleted=False)
         if not self.target_category.can_manage(session.user):
             raise Forbidden(_("You are not allowed to manage the selected destination."))
         if self.target_category.events:
             raise BadRequest(_("The destination already contains an event."))
Example #5
0
 def _process_args(self):
     RHManageCategoryBase._process_args(self)
     target_category_id = request.form.get('target_category_id')
     if target_category_id is None:
         self.target_category = None
     else:
         self.target_category = Category.get_one(int(target_category_id), is_deleted=False)
         if not self.target_category.can_manage(session.user):
             raise Forbidden(_("You are not allowed to manage the selected destination."))
         if self.target_category.events:
             raise BadRequest(_("The destination already contains an event."))
Example #6
0
 def _process_args(self):
     RHManageCategoryBase._process_args(self)
     target_category_id = request.form.get('target_category_id')
     if target_category_id is None:
         self.target_category = None
     else:
         self.target_category = Category.get_or_404(int(target_category_id),
                                                    is_deleted=False)
         if not self.target_category.can_manage(session.user):
             raise Forbidden(
                 _("You are not allowed to manage the selected destination."
                   ))
Example #7
0
 def _process_args(self):
     RHManageCategoryBase._process_args(self)
     self.role = CategoryRole.get_or_404(request.view_args['role_id'])
Example #8
0
 def _process_args(self):
     RHManageCategoryBase._process_args(self)
     self.subcategories = (Category.query.with_parent(self.category).filter(
         Category.id.in_(map(int,
                             request.form.getlist('category_id')))).all())
Example #9
0
 def _process_args(self):
     RHManageCategoryBase._process_args(self)
     self.object_type = 'category'
     self.object = self.base_object = self.category
Example #10
0
 def _process_args(self):
     RHManageCategoryBase._process_args(self)
     self.subcategories = (Category.query
                           .with_parent(self.category)
                           .filter(Category.id.in_(map(int, request.form.getlist('category_id'))))
                           .all())
Example #11
0
 def _process_args(self):
     RHManageCategoryBase._process_args(self)
     self.object_type = 'category'
     self.object = self.base_object = self.category