-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
38 lines (29 loc) · 1.14 KB
/
models.py
File metadata and controls
38 lines (29 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from django.db import models
from django.contrib.auth.models import User
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
is_verfied = models.BooleanField(default=False)
account_id = models.BigIntegerField(default=0)
created_at = models.DateTimeField(auto_now_add=True)
user_email = models.EmailField()
key = models.TextField(default="empty", max_length=200)
otp = models.TextField(max_length=6, default="xxxxxx")
fail_attepmt = models.SmallIntegerField(default=0)
resend_request = models.SmallIntegerField(default=0)
def __str__(self):
return self.user.username
class Newsletter(models.Model):
subscribe_mail = models.EmailField()
def __str__(self):
return self.subscribe_mail
class Notify(models.Model):
notify_mail = models.EmailField()
def __str__(self):
return self.notify_mail
class Contact(models.Model):
name = models.TextField(max_length=100)
subject = models.TextField(max_length=100)
body = models.TextField(max_length=600)
email = models.EmailField()
def __str__(self):
return "Query |" + str(self.pk)