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()
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."))
def _checkProtection(self): RHManageCategoryBase._checkProtection(self) # This is already covered by CategModifBase, but if we ever add more # checks to can_manage_attachments we are on the safe side... if not can_manage_attachments(self.object, session.user): raise Forbidden
def _checkParams(self, params): RHManageCategoryBase._checkParams(self) self.object_type = 'category' self.object = self.base_object = self.category
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())
def _process_args(self): RHManageCategoryBase._process_args(self) self.object_type = 'category' self.object = self.base_object = self.category
def _process_args(self): RHManageCategoryBase._process_args(self) self.role = CategoryRole.get_or_404(request.view_args['role_id'])
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())
def _check_access(self): RHManageCategoryBase._check_access(self) # This is already covered by CategModifBase, but if we ever add more # checks to can_manage_attachments we are on the safe side... if not can_manage_attachments(self.object, session.user): raise Forbidden