django_powerbank.db.models.fields package

Submodules

django_powerbank.db.models.fields.pl module

class django_powerbank.db.models.fields.pl.PlNipField(*args, **kwargs)[source]

Bases: django.db.models.fields.CharField

formfield(**kwargs)[source]

Return a django.forms.Field instance for this field.

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 django_powerbank.db.models.fields.pl.PlRegonField(*args, **kwargs)[source]

Bases: django.db.models.fields.CharField

formfield(**kwargs)[source]

Return a django.forms.Field instance for this field.

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.

Module contents

class django_powerbank.db.models.fields.AutoSlugField(source_field=None, keep_existing=False, source_fallback=False, *args, **kwargs)[source]

Bases: django_powerbank.db.models.fields.SourceFieldMixin, django.db.models.fields.SlugField

get_slug_value(model_instance)[source]
get_source_value(model_instance)[source]
pre_save(model_instance, add)[source]

Return field’s value just before saving.

class django_powerbank.db.models.fields.BinaryMaskEnum[source]

Bases: django_powerbank.db.models.fields.ChoicesIntEnum

An enumeration.

class django_powerbank.db.models.fields.ChoicesIntEnum[source]

Bases: enum.IntEnum

Extends IntEum with django choices generation capability

class django_powerbank.db.models.fields.JSONField(*args, **kwargs)[source]

Bases: django.db.models.fields.TextField

Simple JSON field that stores python structures as JSON strings on database.

from_db_value(value, expression, connection, context)[source]
get_prep_value(value)[source]

Convert value to JSON string before save

to_python(value)[source]

Convert the input JSON value into python structures, raises django.core.exceptions.ValidationError if the data can’t be converted.

validate(value, model_instance)[source]

Check value is a valid JSON string, raise ValidationError on error.

value_from_object(obj)[source]

Return the value of this field in the given model instance.

value_to_string(obj)[source]

Return value from object converted to string properly

class django_powerbank.db.models.fields.MarkDownField(source_field=None, *args, **kwargs)[source]

Bases: django_powerbank.db.models.fields.SourceFieldMixin, django.db.models.fields.TextField

contribute_to_class(cls, name, private_only=False)[source]

Register the field with the model class it belongs to.

If private_only is True, create a separate instance of this field for every subclass of cls, even if cls is not an abstract model.

from_db_value(value, expression, connection)[source]
pre_save(model_instance, add)[source]

Return field’s value just before saving.

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 django_powerbank.db.models.fields.PhoneField(*args, **kwargs)[source]

Bases: django.db.models.fields.CharField

default_validators = [<django_powerbank.core.validators.MsisdnValidator object>]
formfield(**kwargs)[source]

Return a django.forms.Field instance for this field.

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 django_powerbank.db.models.fields.SecretField(source_field=None, *args, **kwargs)[source]

Bases: django_powerbank.db.models.fields.SourceFieldMixin, django.db.models.fields.CharField

pre_save(model_instance, add)[source]

Return field’s value just before saving.

class django_powerbank.db.models.fields.SourceFieldMixin(source_field=None, *args, **kwargs)[source]

Bases: object

check(**kwargs)[source]
class django_powerbank.db.models.fields.UniqueSlugField(source_field=None, keep_existing=False, *args, **kwargs)[source]

Bases: django_powerbank.db.models.fields.AutoSlugField, django.db.models.fields.SlugField

get_slug_value(model_instance)[source]