You are here: Home / LBN / Up2date / Business / BastionLinux 36 / python3-django-permissionedforms-0.1-1.lbn36.noarch

python3-django-permissionedforms-0.1-1.lbn36.noarch

Package Attributes
RPM  python3-django-permissionedforms-0.1-1.lbn36.noarch.rpm Architecture  noarch Size  17254 Created  2025/08/27 10:54:22 UTC
Package Specification
Summary Django extension for creating forms that vary according to user permissions
Group Unspecified
License ZPL
Home Page https://pypi.org/project/django-permissionedforms
Description

django-permissionedforms django-permissionedforms is an extension to Django's forms framework, allowing you to define forms where certain fields are shown or omitted according to the user's permissions. Installation Run: pip install django-permissionedforms Usage To add permission rules to a basic Django form, subclass permissionedforms.PermissionedForm in place of django.forms.Form and add an inner Meta class: from permissionedforms import PermissionedForm

class PersonForm(PermissionedForm): first_name = forms.CharField() last_name = forms.CharField()

class Meta: field_permissions = { 'last_name': myapp.change_last_name }

field_permissions is a dict, mapping field names to permission codenames. For each field listed, that field will only be included in the final form if the user has the specified permission, as defined by the user.has_perm() method. See Django's documentation on custom permissions and programmatically creating permissions f

Requires
rpmlib(PayloadFilesHavePrefix)  
rpmlib(PayloadIsZstd)  
rpmlib(CompressedFileNames)  
rpmlib(PartialHardlinkSets)  
rpmlib(FileDigests)  
Provides
python-django-permissionedforms
python3-django-permissionedforms
python3.10-django-permissionedforms
python3.10dist(django-permissionedforms)
python3dist(django-permissionedforms)
Obsoletes
python-django-permissionedforms

Document Actions