Hi im new using django and is a little confusing the part of model for my project now.
i need to create a site that user can have their profile and make post of product that they want to offer like a catalog and i'm thinking create this models:
class Users_Types(models.Model):
user_type = models.CharField(max_length=1)
def __str__(self):
return self.user_type
return self.id_type_user
class Users(models.Model):
users_types= models.OneToOneField('Users_Types')
e_mail = models.EmailField(unique=True)
password = models.TextField()
salt = models.TextField()
def __str__(self):
return self.id_user
return self.id_type_user
return self.e_mail
return self.password
return self.salt
class Clients(models.Model):
users = models.OneToOneField('Users')
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
ci = models.CharField(max_length=9)
birth_date = models.DateField(null=True, blank=True)
phone = models.CharField(max_length=20)
city = models.CharField(max_length=20, default=)
class products(models.Model):
clients = models.ForeignKey('clients')
product = models.CharField(max_length=30)
description = models.CharField(max_length=30)
Category = models.CharField(max_length=30)
but i read about django have it user model, i had to use that model instead that my Users model?
and how i can link the django user model with my clients model.
i appreciate your help!