django model verbose name
class WaitlistEntry(Timestamps, models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
class Meta:
verbose_name_plural = "Waitlist entries"
django model verbose name
class WaitlistEntry(Timestamps, models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
class Meta:
verbose_name_plural = "Waitlist entries"
create models in django
from django.db import models
# Create your models here.
class Contact(models.Model):
name = models.CharField(max_length=50)
email = models.CharField(max_length=50)
contact = models.CharField(max_length=50)
content = models.TextField()
def __str__(self):
return self.name + ' ' + self.email
what does class meta do in django
from django.db import models
class Ox(models.Model):
horn_length = models.IntegerField()
class Meta:
ordering = ["horn_length"]
verbose_name_plural = "oxen"
//Model metadata is “anything that’s not a field”, such as ordering options (ordering), database table name (db_table), or human-readable singular and plural names (verbose_name and verbose_name_plural). None are required, and adding class Meta to a model is completely optional.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us