akvo.rsr.fields module

class akvo.rsr.fields.LatitudeField(*args, **kwargs)[source]

Bases: FloatField

description = 'Latitude coordinate.'
class akvo.rsr.fields.LimitedTextField(*args, **kwargs)[source]

Bases: ValidXMLTextField

description = 'A TextField that honors the max_length param'
class akvo.rsr.fields.LongitudeField(*args, **kwargs)[source]

Bases: FloatField

description = 'Longitude coordinate.'
class akvo.rsr.fields.NullCharField(*args, db_collation=None, **kwargs)[source]

Bases: CharField

description = 'CharField that stores NULL but returns an empty string'
get_db_prep_value(value, connection, prepared=False)[source]

Return field’s value prepared for interacting with the database backend.

Used by the default implementations of get_db_prep_save().

to_python(value)[source]

Convert the input value into the expected Python data type, raising django.core.exceptions.ValidationError if the data can’t be converted. Return the converted value. Subclasses should override this.

class akvo.rsr.fields.ProjectLimitedTextField(*args, **kwargs)[source]

Bases: LimitedTextField

clean(value, model_instance)[source]

Don’t apply the MaxLengthValidator to “old” projects. OLD_PROJECT_MAX_ID should be lowered as projects are brought within the field length limits and eventually the OLD_PROJECT_MAX_ID can be removed

description = "A TextField that honors the max_length param for 'new' projects"
class akvo.rsr.fields.ValidXMLCharField(*args, **kwargs)[source]

Bases: CharField

description = 'A CharField containing only valid XML characters'
class akvo.rsr.fields.ValidXMLTextField(*args, **kwargs)[source]

Bases: TextField

description = 'A TextField containing only valid XML characters'