Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User(AbstractUser):
- balance = models.DecimalField(max_digits=7, decimal_places=2, blank=True, null=True)
- class WatchList(models.Model):
- user = models.ForeignKey(User, blank=True, null=True, on_delete=models.SET_NULL)
- item = models.ForeignKey(Item, blank=True, null=True, on_delete=models.SET_NULL)
- class Meta:
- unique_together = ('user', 'item')
- class UserSerializer(serializers.ModelSerializer):
- date_joined = serializers.ReadOnlyField()
- class Meta:
- model = User
- fields = ('id', 'email', 'first_name', 'last_name',
- 'date_joined', 'password')
- extra_kwargs = {'password': {'write_only': True}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement