def normalize_value(self, value): minute = transform_for('integer').deserialize(value) if minute < 0 or minute > 59: raise ForbiddenError('Minute filter accepts only numbers from 0 to 59.') return minute
def normalize_value(self, value): second = transform_for('integer').deserialize(value) if second < 0 or second > 59: raise ForbiddenError('Second filter accepts only numbers from 0 to 59.') return second
def normalize_value(self, value): week_day = transform_for('integer').deserialize(value) if week_day < 1 or week_day > 7: raise ForbiddenError('Week day filter accepts only numbers from 1 to 7.') return week_day
def normalize_value(self, value): hour = transform_for('integer').deserialize(value) if hour < 0 or hour > 23: raise ForbiddenError('Hour filter accepts only numbers from 0 to 23.') return hour
def normalize_value(self, value): month = transform_for('integer').deserialize(value) if month < 1 or month > 12: raise ForbiddenError('Month filter accepts only numbers from 1 to 12.') return month
def normalize_value(self, value): day = transform_for('integer').deserialize(value) if day < 1 or day > 31: raise ForbiddenError('Day filter accepts only numbers from 1 to 31.') return day
def normalize_value(self, value): minute = transform_for('integer').deserialize(value) if minute < 0 or minute > 59: raise ForbiddenError( 'Minute filter accepts only numbers from 0 to 59.') return minute
def normalize_value(self, value): month = transform_for('integer').deserialize(value) if month < 1 or month > 12: raise ForbiddenError( 'Month filter accepts only numbers from 1 to 12.') return month
def normalize_value(self, value): second = transform_for('integer').deserialize(value) if second < 0 or second > 59: raise ForbiddenError( 'Second filter accepts only numbers from 0 to 59.') return second
def normalize_value(self, value): hour = transform_for('integer').deserialize(value) if hour < 0 or hour > 23: raise ForbiddenError( 'Hour filter accepts only numbers from 0 to 23.') return hour
def normalize_value(self, value): week_day = transform_for('integer').deserialize(value) if week_day < 1 or week_day > 7: raise ForbiddenError( 'Week day filter accepts only numbers from 1 to 7.') return week_day
def normalize_value(self, value): day = transform_for('integer').deserialize(value) if day < 1 or day > 31: raise ForbiddenError( 'Day filter accepts only numbers from 1 to 31.') return day
def inspect_primary_key(self): primary_key = None for field_name in self.get_all_model_field_names(): field = self.get_model_field(field_name) attr_name = None primary_key = getattr(field, 'primary_key', False) if primary_key and self.is_one_to_one_field(field_name, field): attr_name = field_name + '_id' if primary_key: kind = kind_of_field(field) transform = transform_for(kind) primary_key = PrimaryKey(transform=transform, attr_name=attr_name) break setattr(self.resource, '_primary_key', primary_key)
def normalize_value(self, value): return transform_for('boolean').deserialize(value)
def normalize_value(self, value): return transform_for('integer').deserialize(value)