Django Rest Nested Serializer in Reverse Relationship -


i writing post api in django rest framework, model structure is, company model is,

class company(models.model):     company_name = models.charfield(max_length=255, verbose_name='company name')     user = models.foreignkey(user_profile)     company_address = models.charfield(max_length=255, null=true, blank=true,      verbose_name='company address') 

and user_profile table is,

class user_profile(models.model):     name = models.charfield(max_length=255)     email_id = models.emailfield(max_length=255, verbose_name="email id") 

company , user_profile relationship 1 one, there way company info user_profile email address in 1 query.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -