Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.db import models
- from django.contrib.auth.models import User
- from datetime import datetime
- import pytz
- # Create your models here.
- class Sleep(models.Model):
- user = models.ForeignKey(User,on_delete=models.CASCADE)
- start = models.DateTimeField(default=datetime.now())
- end = models.DateTimeField(default=datetime.now())
- def __str__(self):
- return f'{self.user.username} - {self.start}/{self.end}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement