Ejemplo n.º 1
0
class Animal(models.Model):
    name= models.Charfield(max_length= 50)
    breed= models.Charfield(max_length=50)
    age= models.IntegerField()
    owner= models.ManyToManyField(User, related_name="animals")
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
Ejemplo n.º 2
0
class Podcast(models.Model):
    Id = models.Integerfield(blank=False, null=False)
    Name = models.Charfield(max_length=100, null=False, blank=False)
    Duration = models.Decimalfield(max_digits=4, decimal_places=2, blank=False)
    Uploaded time = models.Integerfield(datetime.Datetime, blank=False)
    Host = models.Charfield(max_length=100, blank=False)
    Participants = models.Textfield(max_length=100, blank=True, end={''})
class User(models.Model):
    first_name = models.CharField(max_length=20)
    last_name = models.Charfield(max_length=20)
    email = models.Charfield(max_length=20)
    password = models.CharField(max_length=20)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
Ejemplo n.º 4
0
class Condition(models.Model):
    condition_name = models.Charfield(max_length=200)
    description = models.Charfield(max_length=200)
    other_details = models.Charfield(max_length=200)

    def __str__(self):
      return self.condtion_name
Ejemplo n.º 5
0
class booking(models.Model):
    venue = models.CharField()
    event_name = models.CharField()
    date = models.DateField()
    time = models.Charfield()
    college = models.Charfield()
    email = models.EmailField()
Ejemplo n.º 6
0
class PyMonitor(models.model):

	location = models.Charfield('Ubicacion', null=True , blank=True)
	ip =  models.Charfield('ip', null=True , blank=True)
	#Cambiar ip por nombrededominio que refiera al pasillo
	category = models.IntegerField("Categoria", max_length=2, null=True, blank=True)
        description = models.CharField("Descripcion del raspberry pi", max_length=200, null=True, blank=True)
Ejemplo n.º 7
0
class Article(models.Model):
	articleId = models.CharField(max_length=140)
	title = models.Charfield(max_length=256)
	subtitle = models.Charfield(max_length=256)
	authorId = models.ForeignKey(Author, related_name='authorID')
	body = model.TextField()
	sources = models.TextField()
Ejemplo n.º 8
0
class books(models.Model):
	name = models.Charfield(max_length = 255)
	desc = models.Charfield(max_length = 1000)
	likes = models.ManyToManyField(user, related_name = 'liked')
	uploader = models.ForeignKey(user, related_name = 'uploaded_by')
	created_at = models.DateTimeField(auto_now_add = True)
	updated_at  = models.DateTimeField(auto_now = True)
	
Ejemplo n.º 9
0
class User(models.Model):
	first_name=models.Charfield(max_length=50)
	last_name=models.Charfield(max_length=50)
	address=models.ForeignKey(Address,related_name="users_address")
	created_at=models.DateTimeField(auto_now_add=True)
	updated_at=models.DateTimeField(auto_now_add=True)
	def __repr__(self):
		return "<User Object: {} {}>".format(self.first_name,self.last_name)
Ejemplo n.º 10
0
class Address(models.Model):
	address_line1=models.Charfield(max_length=60)
	address_line2=models.Charfield(max_length=60)
	city=models.Charfield(max_length=30)
	state=models.Charfield(max_length=30)
	pincode=models.Charfield(max_length=10)
	def __repr(self):
		return "<Address Object:{} {} {} {} {}>".format(self.address_line1,self.address_line2,self.city,self.state,self.pincode)
Ejemplo n.º 11
0
class Student(models.Model):
    s_name = models.Charfield(max_length=100)
    s_major = models.Charfield(max_length=100)
    s_age = models.IntegerField(default = 0)
    s_gender = models.CharField(max_length=30)
    s_attendence = models.IntergerField(default=0)

    def __str__(self):
        return self.s_name
Ejemplo n.º 12
0
class User(models.Model):
    first_name = models.Charfield(max_length=255)
    last_name = models.Charfield(max_length=255)
    email = models.Charfield(max_length=255)
    password = models.charfield(max_length=255)
    date_of_birth = models.DateTimeField()
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    objects = UserManager();
Ejemplo n.º 13
0
class Book(models.Model):
    title = models.Charfield(max_length=255)
    isbn = models.Charfield(max_length=255)
    publisher = models.Charfield(max_length=255)
    genre = models.DateTimeField(auto_now_add=True)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    author = models.ForeignKey(Author, related_name="my_books")
    likes = models.ManyToManyField(User, related_name="user_likes")
Ejemplo n.º 14
0
class Contact(mpdels.Model):
    first_name = models.Charfield(max_length=50)
    last_name = models.Charfield(max_length=50)
    email = models.EmailField()
    message = models.TextField()

    def __str__(self):
        return f'{self.first_name} {self.last_name}'
        
Ejemplo n.º 15
0
class Report(models.Model):
    CHC_LANG = (("English", "English"), ("Hindi", "Hindi"))
    # https://stackoverflow.com/questions/6928692/how-to-express-a-one-to-many-relationship-in-django
    content = models.ForeignKey(Content)
    r_id = models.BigAutoField(primary_key=True)
    r_status = models.BooleanField()
    r_date = models.DateField()
    r_lang = models.Charfield(max_length=100, choices=CHC_LANG)
    r_title = models.Charfield(max_length=200)
Ejemplo n.º 16
0
class PrimaryInfo(models.Model):
	first_name = models.Charfield(max_length=25)
	last_name = models.Charfield(max_length=25)
	cell_phone = models.Charfield(max_length=25)
	email = models.EmailField()

	def __str__(self):
		return self.last_name
		return self.cell_phone
Ejemplo n.º 17
0
class employe(models.Model1):
    generes=(
            ('f', 'female'),
            ('M', 'Male')
)
    
    lastname=models.Charfield(max_leght=50,help_text='Ingrese el apellido del empleado')
    age=models.Charfield(max_legth=20,help_text='Ingrese la edad del empleado')
    date of birthday=models.datefield(help_text='Ingrese la fecha de nacimiento del empleado')
    category=  models.CharField(max_length=1, help_text= 'Seleccione el sexo del empleado' choices=generes)
Ejemplo n.º 18
0
class Relationship(Base):

    name = models.Charfield(max_length=255)
    display_name = models.Charfield(max_length=255)
    family_info = models.ForeignKey(FamilyInfo)

    objects = RelationshipManager()

    def __unicode__(self):
        return str(self.name) + ' ' + str(self.display_name) + ' '
Ejemplo n.º 19
0
class contact(models.Model):
    name =models.Charfield(max_length = 122)
    email =models.Charfield(max_length = 122)
    phone =models.Charfield(max_length = 122)
    
    desc = models.Charfield ()
    date = models.DateField () 

    def_str_(self)
       return self.name
Ejemplo n.º 20
0
class Donations(models.Model):
  user = models.OneToOneField(User, on_delete=models.CASCADE)
  facility = models.Charfield(max_length=200)
  donate_date = models.DateTimeField(auto_now_add=True)
  last_donate_date = models.DateField(auto_now_add=True)
  location = models.Charfield(max_length=50)
  blood_group = models.Charfield(max_length=50)
  medical_condition = models.ForeignKey(Donors, on_delete=models.CASCADE)

  def __str__(self):
    return self.blood_group
Ejemplo n.º 21
0
class Audiobook(models.Model):
    Id = models.Integerfield(blank=False, null=False)
    Title = models.Charfield(max_length=100, null=False, blank=False, end={''})
    Author = models.Charfield(max_length=100, null=False, blank=False, end={''})
    Narrator = models.Charfield(max_length=100, null=False, blank=False, end={''})
    Duration = models.Decimalfield(max_digits=4, decimal_places=2, blank=False)
    Uploaded time = models.Integerfield(datetime.Datetime, blank=False)


    def __str__(self):
        return self.name
Ejemplo n.º 22
0
class Customer(models.Model):
    user_id = models.AutoField(primary_key=True)
    user_firstName = models.CharField(max_length=50, unique=True)
    user_lastName = models.CharField(max_length=50, unique=True)
    user_email = models.CharField(max_length=50, unique=True)
    user_password = models.CharField(max_length=10)
    answer1 = models.Charfield(max_length=50)
    answer2 = models.Charfield(max_length=50)

    def __str__(self):
        return (self.user_lastName)
Ejemplo n.º 23
0
class Person(Base):
    GENDER = (
        ('Male', 'Male'),
        ('Female', 'Female'),
        ('Other', 'Other'),
    )

    person_id = models.Charfield(max_length=255, primary_key=True)
    first_name = models.Charfield(max_length=255)
    last_name = models.Charfield(max_length=255)
    dob = models.DateField(auto_now=False,
                           auto_now_add=False,
                           null=True,
                           blank=True)
    gender = models.CharField(max_length=20, choices=GENDER)
    mobile_number = models.CharField(max_length=255,
                                     db_index=True,
                                     editable=True)
    email_id = models.EmailField(max_length=255,
                                 db_index=True,
                                 null=True,
                                 blank=True,
                                 editable=True)
    user_password = models.TextField(max_length=255)
    relatives = models.ManyToManyField('Relatives')
    family_info = models.ForeignKey(FamilyInfo)

    objects = PersonManager()

    def __unicode__(self):
        return str(self.first_name) + ' ' + str(self.last_name) + str(
            self.email_id)

    def add_relatives(self, relative_obj):
        self.relatives.add(relative_obj)

    def search_relatives(self, relation_name):
        relatives_list = self.relatives.select_related('relationship').all()
        result_list = list()
        for relative in relatives_list:
            if relative.name.lower() == relation_name.lower():
                result_list.append(relative.person)
        return result_list

    def serializer(self):
        data = dict()
        data['person_id'] = self.person_id
        data['first_name'] = self.first_name
        data['last_name'] = self.last_name
        data['dob'] = self.dob
        data['gender'] = self.gender
        data['mobile_number'] = self.mobile_number
        return data
Ejemplo n.º 24
0
class Contact(mpdels.Model):
    first_name = models.Charfield(max_length=50)
    last_name = models.Charfield(max_length=50)
    email = models.EmailField()
    message = models.TextField()
    age	 = models.TextField()
    birthday = models.TextField()
    phone_number = models.TextField()
    is_cell	= models.TextField()
    comments = models.TextField()	

    def __str__(self):
        return f'{self.first_name} {self.last_name}'
Ejemplo n.º 25
0
class restaurant(models.Model):
    categories =(
    ('B','Breakfast'),
    ('L','Lunch'),
    ('Dn','Dinner'),
    ('Dr','Drinks'),
    ('D','Dessert')
    )
    title=models.CharField(max_lenght=60,help_text='Ingrese la descripcion del platillo:')
    typerestaurant=models.Charfield(max_lenght=50,held_text='Que tipo de platillo desea:')
    price=models.Charfield(max_lenght=50,held_text='El precio del platillo es:')
    time=models.Charfield(max_lenght=50,held_text='El tiempo del platillo es:')
    category=models.Charfield(max_lenght=1,help_text='Seleccione su platillo:' choices=categories)
Ejemplo n.º 26
0
class Hospital(models.Model):
    name = models.CharField(max_length=255, null=False)
    location = models.Charfield(max_length=255, null=False)
    tillNumber = models.IntegerField()

    def __str__(self):
        return self.name
Ejemplo n.º 27
0
class Products(model.Models):

    image = models.ImageField(upload_to='products/', blank=True)
    brand = models.Charfield()

    def __str__(self):
        return self.brand
Ejemplo n.º 28
0
class Style(model.Models):

    image = models.ImageField(upload_to='products/', blank=True)
    name = models.Charfield()

    def __str__(self):
        return self.name
Ejemplo n.º 29
0
class PurchaseOrder(models.Model):
    po_number = modles.Autofield()
    organization = models.Foreignkey(Organization)
    shipto = models.ForeignKey(Location)
    soldby = models.Charfield(max_length=25)
    lineitem = modles.Foreignkey(PoDetalis)
    expected_by = models.DateTimefield()
class User(models.Model)
    first_name = models.CharField(max_length=20)
    last_name = models.Charfield(max_length=20)
    email = 
    password = 
    created_at = models.DateTimeField(auto_)
    updated_at =