Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SC-16] Added account model #14

Merged
merged 2 commits into from
Feb 5, 2025
Merged

[SC-16] Added account model #14

merged 2 commits into from
Feb 5, 2025

Conversation

Fungucide
Copy link
Collaborator

Added basic account model to Django for future use.

@Fungucide Fungucide changed the title [SC-16] Added account model Draft: [SC-16] Added account model Feb 3, 2025
@Fungucide Fungucide changed the title Draft: [SC-16] Added account model [SC-16] Added account model Feb 3, 2025
)
first_name = models.CharField(_("first name"), max_length=150, blank=True)
last_name = models.CharField(_("last name"), max_length=150, blank=True)
is_staff = models.BooleanField(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not fully sure if is_staff and is_active are really required.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just emulating the default Django user model since they have the staff accounts that can access the admin site. Not too sure if the is_active field is needed, but also present in the default Django user model.

@@ -0,0 +1,31 @@
from django.contrib.auth.base_user import BaseUserManager

Copy link
Collaborator

@VamsiGajjela VamsiGajjela Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might have to utilize serializers instead of doing it this way. This is important since we will be using django with the rest framework

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this cause most of the tutorials used this method to get rid of usernames for User accounts. This is just overriding the actual model creation and is based on the default Django UserManager. Not really sure if we can get away with not using this.

@Fungucide Fungucide merged commit 23f8ac5 into main Feb 5, 2025
1 check passed
@Fungucide Fungucide deleted the william_16_user_model branch February 5, 2025 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants