Skip to content

Commit

Permalink
Add 'is_supermaker' field to 'CustomUser'. Add 'is_supermaker' to Dja…
Browse files Browse the repository at this point in the history
…ngo Admin Users' list view.
  • Loading branch information
brucestull committed Dec 23, 2022
1 parent adf3e6f commit 820d682
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,36 @@

* NOTE: Author is using PowerShell for this guide.

## Notes:
## Resources

* [`router.register` - `basename`](https://www.django-rest-framework.org/api-guide/routers/#usage)
* `basename`
* The base to use for the URL names that are created. If unset the basename will be automatically generated based on the queryset attribute of the viewset, if it has one. Note that if the viewset does not include a queryset attribute then you must set basename when registering the viewset.

## Notes

* **TODO**: Need to check [Deployment checklist - docs.djangoproject.com](https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/)
* [Project Directory Structure](notes/00_directory_structure.md)

## Setup Process:
## Setup Process

1. [Setup Process](./notes_setup/README.md)

## Build the Application:
## Build the Application

1. [Build Print Tracker Application](./notes/README.md)

## Project State at Commits:
## Project State at Commits

* [`ModelPrintFormView`, `ModelPrintCreateView`, and `model_print_create_function` views example comparison - includes print statements](https://github.com/brucestull/see-3d/tree/df16b65892b0c7100eb11763e5b964297ee3a42d)

## Excellent resources, this project wouldn't have been possible without these:
## Excellent resources, this project wouldn't have been possible without these

* CustomUser method: [Django Best Practices: Custom User Model - Will Vincent - learndjango.com](https://learndjango.com/tutorials/django-custom-user-model)
* Docutils: [The Django admin documentation generator - docs.djangoproject.com](https://docs.djangoproject.com/en/4.0/ref/contrib/admin/admindocs/)
* DEV and PROD settings: [Configuring Django Settings for Production - thinkster.io](https://thinkster.io/tutorials/configuring-django-settings-for-production)

## Links to this project's pages:
## Links to this project's pages

* Repository: [Flynnt Knapp's Print Tracker](https://github.com/brucestull/see-3d)
* Production Deployment: https://flynnt-knapp-print-tracker.herokuapp.com/
* Production Deployment: <https://flynnt-knapp-print-tracker.herokuapp.com/>
1 change: 1 addition & 0 deletions accounts/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class CustomUserAdmin(UserAdmin):
list_display = (
'username',
'email',
'is_supermaker',
)

admin.site.register(CustomUser, CustomUserAdmin)
18 changes: 18 additions & 0 deletions accounts/migrations/0002_alter_customuser_is_supermaker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0 on 2022-12-23 08:51

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('accounts', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='customuser',
name='is_supermaker',
field=models.BooleanField(default=False, help_text='Designates whether the user is a Supermaker. Supermakers may gain special privileges in the future.'),
),
]

0 comments on commit 820d682

Please sign in to comment.