Thank Mike Dewhirst is working well
Cheers
On Fri, Jan 25, 2019 at 6:49 AM 'Amitesh Sahay' via Django users <
django-users@googlegroups.com> wrote:
> hi,
>
> All the above should work. If you are working on django REST, then you can
> use ModelSerializer helper function. This will automatically
hi,
All the above should work. If you are working on django REST, then you can use
ModelSerializer helper function. This will automatically sync with the table
fields, and if there are any foreign key and primary key. They would be mapped
automatically.
Regards,
Amitesh Sahay91-750 797 8619
You can do this easily by creating creating an object of that model from
which you want to get the value or input a value by using
'get_object_or_404' or 'get_list_or_404' by importing from
django.shortucts. Reas about these two functions and difference between
them in documentation.
Use them, for
You can use this where you want you to link tables with foreign key
models.ForeignKey(Model_Name,on_delete=models.CASCADE)
That's it both tables will be in relation after migration of models into
database
On Fri, Jan 25, 2019 at 12:20 PM Mike Dewhirst
wrote:
> On 24/01/2019 5:28 pm, carlos
On 24/01/2019 5:28 pm, carlos wrote:
Hello,
I do not know if I'm asking the question correctly, but I need to call
a field of one model in another model
example:
class ModelDad(models.Model):
name = blablabla
class ModelChild1():
fk(ModelDad)
number = models.IntegerField()
class
Hello,
I do not know if I'm asking the question correctly, but I need to call a
field of one model in another model
example:
class ModelDad(models.Model):
name = blablabla
class ModelChild1():
fk(ModelDad)
number = models.IntegerField()
class ModelChild2():
fk(ModelDad)
anot
6 matches
Mail list logo