Created
May 22, 2020 21:19
-
-
Save NurElHuda/1929a639c520dfdff03558c1fff24315 to your computer and use it in GitHub Desktop.
Django_rest_framework_nested_serializer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.contrib.auth.models import User | |
from django.utils import timezone | |
class Client(models.Model): | |
created_at = models.DateTimeField(default=timezone.now) | |
updated_at = models.DateTimeField(default=timezone.now) | |
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='clients', null=True, blank=True) | |
last_login_date = models.DateField(default=timezone.now, null=True, blank=True) | |
points = models.IntegerField() | |
# other fields... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment