Saves the current user with an Aldryn Form for DjangoCMS.
Project description
An extension to the Aldryn Forms plugin that adds a Current User form field type. If there is a valid logged-in user session (request.user), that user’s information will be saved along with the form submission.
When you build your form, you can select to save the user’s:
- User ID
- Username
- Email Address
- Full Name
Installation
Install via pip:
pip install djangocms-currentuser-field
Add to your INSTALLED_APPS (in settings.py):
INSTALLED_APPS = ( ... 'djangocms-currentuser-field', ... ) # Optional, if you'd like to use a subclass (1:1 relationship) attached # to user for the user id field, specify below CURRENTUSER_FIELD_USER_SUBCLASS = 'staff' # Optional, if you'd like to specify a custom fields off the user or # sub-user class, set a list of tuples: CURRENTUSER_FIELD_CUSTOM_VALUES = [ ('canvote', 'Voting Status') ]
Run migrations:
python manage.py migrate djangocms-current-user
“Current User Field” should now be available as a plugin in the CMS when you build a form!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size djangocms_currentuser_field-0.4-py2-none-any.whl (12.4 kB) | File type Wheel | Python version py2 | Upload date | Hashes View |
Filename, size djangocms-currentuser-field-0.4.tar.gz (9.2 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for djangocms_currentuser_field-0.4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21532ed5c5eb40176e01abb8aaac68926fb8451fb4b610584ada78faf8c9cd77 |
|
MD5 | 3bef7f0861893888fcabafd4d2ad44b1 |
|
BLAKE2-256 | 05a3eefd5bd6757ba7af09ccc29c33cb3de6873c3b2170209f3dc49f2fca1bcd |
Close
Hashes for djangocms-currentuser-field-0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14498a6d747801db73f992ea10e5a114da02c9e5e0e612260e7436f4fe2c33d5 |
|
MD5 | 7f010a53503fe721bc09db79ee1f7349 |
|
BLAKE2-256 | 0472237f8a9ea9a7f973a83467ba3d2be60f3f680f9ec577c134010b69066a9e |