I've updated a little models ( OneToOne field is better for your case) Take
a look at
https://docs.djangoproject.com/en/dev/ref/models/fields/
result model is :
class B(models.Model):
""" Model B"""
keyfield = models.OneToOneField('mymodel.A')
name_b = models.CharField(max_length=
Thank you for your answer, that i managed to achive,
what I want is to display on the admin object list of object B, display
name_B and name_A
Anyway
Thanks
Alex
Terça-feira, 7 de Maio de 2013 13:43:59 UTC+1, Sergiy Khohlov escreveu:
>
> this not hard :
>
> from django.db import models
>
> #
this not hard :
from django.db import models
# Create your models here.
class A(models.Model):
""" model A """
name_a = models.CharField(max_length=20)
def __unicode__(self):
return self.name_a
class B(models.Model):
""" Model B"""
keyfield = models.Foreign
3 matches
Mail list logo