Re: Nested Model

2019-09-22 Thread Davin Pore
; >> [image: API_Box.JPG] >> >> >> On Thursday, 19 September 2019 14:35:03 UTC+8, Davin Pore wrote: >>> >>> Seeking for your kind assistance on how to get the value of this using >>> nested model on django restapi. >>> >>> [image: image.p

Re: Nested Model

2019-09-19 Thread Ayser shuhaib
your kind assistance on how to get the value of this using >> nested model on django restapi. >> >> [image: image.png] >> Thank you. >> >> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To

Re: Nested Model

2019-09-19 Thread Davin Pore
[image: API_Box.JPG] On Thursday, 19 September 2019 14:35:03 UTC+8, Davin Pore wrote: > > Seeking for your kind assistance on how to get the value of this using > nested model on django restapi. > > [image: image.png] > Thank you. > > -- You received this message be

Re: Nested Model

2019-09-18 Thread Ayser shuhaib
Hello Davin, The image is not opening On Thu, 19 Sep 2019 at 08:35, Davin Pore wrote: > Seeking for your kind assistance on how to get the value of this using > nested model on django restapi. > > [image: image.png] > Thank you. > > -- > You received this message becau

Nested Model

2019-09-18 Thread Davin Pore
Seeking for your kind assistance on how to get the value of this using nested model on django restapi. [image: image.png] Thank you. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Re: Nested Model Issue

2019-08-11 Thread Soumen Khatua
Actually my query is different I want to do Get, Post and Update(Crud) operation by using rest framework on that following models. Thanks for your response. On Sun, 11 Aug 2019, 03:08 mohamed habib, wrote: > You can use a signal to ensure that a profile is created for each user. > Make sure all

Re: Nested Model Issue

2019-08-10 Thread mohamed habib
You can use a signal to ensure that a profile is created for each user. Make sure all the fields in your Profile model are nullable: ``` class Profile(models.Model): GENDER_CHOICES = ( ('male', 'Male'), ('female', 'Female') ) user = models.ForeignKey(User,on_delete=models.

Nested Model Issue

2019-08-10 Thread Soumen Khatua
Hi Folks, My requirement is whenever i create a user in post method that user can pass username and password, Address models contain some field and Profile models contains some field. If he is authenticated users and want to create one prifile he need to pass Address model contains some field and P

Re: OneToOne? Inheritance? Another solution for nested model relationships?

2014-05-30 Thread Rafael E. Ferrero
2014-05-26 18:33 GMT-03:00 Daniele Procida : > I've an application that's been happily running for a few years, that does > this: > > class Person(Model): ># everyone's a Person > > class Researcher(Model): > # a Researcher is Person who publishes research > person = models.OneToOneFie

Re: OneToOne? Inheritance? Another solution for nested model relationships?

2014-05-30 Thread Leonardo Giordani
I see your point. In this case I'd recommend giving Researcher two foreign keys, one towards a Student model and one towards a Staff one, then add some logic to the model to easily check the actual specialization or to convert it among them. Basically you get a Researcher that "owns" a Student or a

Re: OneToOne? Inheritance? Another solution for nested model relationships?

2014-05-28 Thread Daniele Procida
On Wed, May 28, 2014, Leonardo Giordani wrote: >I usually solve such issues with Inheritance. I feel comfortable with it >because it lets me (in your example) to manage both ResearchStudent and >ResearchStaff independently, while keeping the Researcher parent model >available to deal with "global

Re: OneToOne? Inheritance? Another solution for nested model relationships?

2014-05-28 Thread Leonardo Giordani
Daniele, I usually solve such issues with Inheritance. I feel comfortable with it because it lets me (in your example) to manage both ResearchStudent and ResearchStaff independently, while keeping the Researcher parent model available to deal with "global" queries and data interaction. As always

OneToOne? Inheritance? Another solution for nested model relationships?

2014-05-26 Thread Daniele Procida
I've an application that's been happily running for a few years, that does this: class Person(Model): # everyone's a Person class Researcher(Model): # a Researcher is Person who publishes research person = models.OneToOneField(Person) class Publication(Model): author = models.Fore

Re: Thoughts on nested Model references and JSON serialization

2009-02-13 Thread mattimust...@gmail.com
Hi, I've finally pulled my finger out and written up some documentation on how to use my serializers. You can find it at: http://code.google.com/p/wadofstuff/wiki/DjangoFullSerializers On Feb 14, 11:23 am, "mattimust...@gmail.com" wrote: > On Feb 13, 10:31 pm, "django_fo...@codechimp.net" > >

Re: Thoughts on nested Model references and JSON serialization

2009-02-13 Thread mattimust...@gmail.com
On Feb 13, 10:31 pm, "django_fo...@codechimp.net" wrote: > By multiple calls I meant calls from the browser to the server. > Right, in my case, now I may one call to get a list of news articles. > One potential solution here would be to make the call to get the list > of articles, then make ano

Re: Thoughts on nested Model references and JSON serialization

2009-02-13 Thread django_fo...@codechimp.net
Obviously I was tired when I wrote this. I apologize for the grammatical errors, which were a-plenty. On Feb 12, 5:51 pm, Russell Keith-Magee wrote: > On Thu, Feb 12, 2009 at 10:17 PM, django_fo...@codechimp.net > > > > wrote: > > > I wanted to get the communities thoughts on this subject.  I

Re: Thoughts on nested Model references and JSON serialization

2009-02-13 Thread django_fo...@codechimp.net
By multiple calls I meant calls from the browser to the server. Right, in my case, now I may one call to get a list of news articles. One potential solution here would be to make the call to get the list of articles, then make another call to get the author for each article. I mentioned exponenti

Re: Thoughts on nested Model references and JSON serialization

2009-02-12 Thread Russell Keith-Magee
On Thu, Feb 12, 2009 at 10:17 PM, django_fo...@codechimp.net wrote: > > I wanted to get the communities thoughts on this subject. I am > working on a simple site that has news articles, each of which has a > reference to a User object provided by django.contrib.auth that is the > author of the n

Thoughts on nested Model references and JSON serialization

2009-02-12 Thread django_fo...@codechimp.net
I wanted to get the communities thoughts on this subject. I am working on a simple site that has news articles, each of which has a reference to a User object provided by django.contrib.auth that is the author of the news article. This is done right now using the following code: class NewsArtic