Re: Adding Two Models In Django

2021-06-17 Thread Ayush Bisht
class Year(models.Model): year = models.IntegerField() class Month(models.Model): MONTH_CHOICE = ( (1 , "Jan"), (2, 'Feb'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'Aug'), (9, 'Sept'),

Re: Adding Two Models In Django

2021-06-16 Thread Ridwan Adeyemo
Thanks man.👍 On Wed, Jun 16, 2021, 5:22 PM Ayush Bisht wrote: > I think you are trying to sum up the value of two model fields and store > them in some other field. > > > so for that u can proceed from base. > > simple you just have to update that field in save method > > for example : > *class

Re: Adding Two Models In Django

2021-06-16 Thread Ayush Bisht
I think you are trying to sum up the value of two model fields and store them in some other field. so for that u can proceed from base. simple you just have to update that field in save method for example : *class Student(models.Model):* maths_score = models.DecimalField() en

Re: Adding Two Models In Django

2021-06-15 Thread Ridwan Adeyemo
Please kindly describe with images. On Tue, Jun 15, 2021, 9:52 PM Sebastian Jung wrote: > Hello, > > You create all modelfields inkl. Total sum and after user submit Form with > 2 fields in save() Method you sum both fields together ans write this in > total field... > > Regards > > Ridwan Adeye

Re: Adding Two Models In Django

2021-06-15 Thread Sebastian Jung
Hello, You create all modelfields inkl. Total sum and after user submit Form with 2 fields in save() Method you sum both fields together ans write this in total field... Regards Ridwan Adeyemo schrieb am Di., 15. Juni 2021, 20:34: > How do I add two models together in the database, two differe

Re: Adding Two Models In Django

2021-06-15 Thread Ridwan Adeyemo
Thanks for the response. Kindly explain more or provide image description. Best regards On Tue, Jun 15, 2021, 8:09 PM patel dhruvish wrote: > Use foreign key in 1 model for initiat another model... > > On Wed, Jun 16, 2021, 00:04 Ridwan Adeyemo > wrote: > >> How do I add two models together in

Re: Adding Two Models In Django

2021-06-15 Thread patel dhruvish
Use foreign key in 1 model for initiat another model... On Wed, Jun 16, 2021, 00:04 Ridwan Adeyemo wrote: > How do I add two models together in the database, two different > DecimalField. > i.e math_score + eng_score = total_score > > -- > You received this message because you are subscribed to