django_prbac Package

django_prbac Package

admin Module

arbitrary Module

decorators Module

exceptions Module

exception django_prbac.exceptions.PermissionDenied[source]

Bases: Exception

fields Module

class django_prbac.fields.StringListField(verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class 'django.db.models.fields.NOT_PROVIDED'>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, db_tablespace=None, auto_created=False, validators=(), error_messages=None)[source]

Bases: django.db.models.fields.TextField

A Django field for lists of strings

formfield(**kwargs)[source]

The default form field is a StringListFormField.

from_db_value(value, expression, connection, *args, **kwargs)[source]
get_prep_value(value)[source]

Converts the value, which must be a string list, to a comma-separated string, quoted appropriately. This format is private to the field type so it is not exposed for customization or any such thing.

is_string_list(value)[source]
to_python(value)[source]

Best-effort conversion of “any value” to a string list.

It does not try that hard, because curious values probably indicate a mistake and we should fail early.

value_to_string(obj)[source]

Return a string value of this field from the passed obj. This is used by the serialization framework.

class django_prbac.fields.StringSetField(verbose_name=None, name=None, primary_key=False, max_length=None, unique=False, blank=False, null=False, db_index=False, rel=None, default=<class 'django.db.models.fields.NOT_PROVIDED'>, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, db_tablespace=None, auto_created=False, validators=(), error_messages=None)[source]

Bases: django_prbac.fields.StringListField

A Django field for set of strings.

from_db_value(value, expression, connection, *args, **kwargs)[source]
get_prep_value(value)[source]

Converts the value, which must be a string list, to a comma-separated string, quoted appropriately. This format is private to the field type so it is not exposed for customization or any such thing.

is_string_set(value)[source]
to_python(value)[source]

Best-effort conversion of “any value” to a string set. Mostly strict, but a bit lenient to allow lists to be passed in by form fields.

value_to_string(obj)[source]

Return a string value of this field from the passed obj. This is used by the serialization framework.

mock_settings Module

Settings just for running the django-prbac tests or checking out the admin site.

models Module

urls Module