class Client(models.Model): name = models.CharField('Name', max_length=250) surname = models.CharField('Surname', max_length=250) phone = models.CharField('Phone', max_length=10) ... def __str__(self): return str(self.surname ) + ' | ' + str(self.name) class Checklist(models.Model): client_name = models.ForeignKey(Client, on_delete=models.CASCADE) point1 = models.BooleanField('point1', default=False) point2 = models.BooleanField('point2', default=False) point3 = models.BooleanField('point3', default=False) ... def __str__(self): return self.client_name How can i provide or add all Client properties to Checklist instance? (note: I create Checklist object via forms.py) And when it's done how to get an access to Client properties using Checklist object?
HELLo... i want to do a oniline courses website ... and each course should have lectures but when i call it in the template i get the course name repeated with only one lecture .. help plz !!!
Great content Anthony, A huge fan from Nigeria. I am about to begin your Django tutorial series. I just finished Flask Series and I'm pretty good with Flask. :) Continue to make good contents for us. Thanks a lot
Hi brother, would you please help me, I am new in Django I have two models by name of Buildings(Name, Status, Descriptions) and Floors (Building as foreign key , Name, Status, Descriptions) now in the Floors form I want to display only the building which their status is true.
what if we have another class object attribute in subject model and how can we relate it to the student model class object attribute minor using the foreignkey
Join my Django Database Essentials course here: prettyprinted.com/djangodatabase
Pretty simple and straightforward explanation. Thank you for sharing it with us :)
class Client(models.Model):
name = models.CharField('Name', max_length=250)
surname = models.CharField('Surname', max_length=250)
phone = models.CharField('Phone', max_length=10)
...
def __str__(self):
return str(self.surname ) + ' | ' + str(self.name)
class Checklist(models.Model):
client_name = models.ForeignKey(Client, on_delete=models.CASCADE)
point1 = models.BooleanField('point1', default=False)
point2 = models.BooleanField('point2', default=False)
point3 = models.BooleanField('point3', default=False)
...
def __str__(self):
return self.client_name
How can i provide or add all Client properties to Checklist instance? (note: I create Checklist object via forms.py) And when it's done how to get an access to Client properties using Checklist object?
this is what i've been looking for. Thank you :)
This helped solve the problem I was struggling with for like two hours, thank you!!
HELLo... i want to do a oniline courses website ... and each course should have lectures but when i call it in the template i get the course name repeated with only one lecture .. help plz !!!
Is it just curiousity or math majors just happen to know a lot more than just math
Thank you my dude. This really helped me.
bless your heart!
Great content Anthony, A huge fan from Nigeria. I am about to begin your Django tutorial series. I just finished Flask Series and I'm pretty good with Flask. :) Continue to make good contents for us. Thanks a lot
You're welcome! I'm glad you like the videos.
Thanks for explain is pretty simple.
If I have two foreignkey from two different classes . Can they get the same related_name?
Thank you.
Hi brother, would you please help me, I am new in Django I have two models by name of Buildings(Name, Status, Descriptions) and Floors (Building as foreign key , Name, Status, Descriptions) now in the Floors form I want to display only the building which their status is true.
Thanks a lot
math.major.all() ==> why can't I do this?
thx Anthony
what if we have another class object attribute in subject model and how can we relate it to the student model class object attribute minor using the foreignkey
So the related_name need only for the ORM ? what the analogy in SQL?
good
God bless you man... You save an hour of mine. 👍👍
Thanks Anthony !! Really helpful 👍
Awesome...as always :)
Thanks for watching!
Thanks for so helpfull video!!!
Thanks ! very clear explanation
great... explained so neatly... thank you.
Excellent video, thanks!
hi bro can u suggest me what i have to do after Django web-development.I m confused what to start next
learn some frontend, and start making web apps
thanks for the help man, But is null=True same as blank=True?
no
null means that attribute could be equal to zero
e.g. item_quantity could be zero, but it can`t be empty
Thanks for this video
you are a life saver