Thanks Russell, it works with the get_accessor_name() method combinated with
the model attribute.
2007/8/23, Russell Keith-Magee <[EMAIL PROTECTED]>:
>
>
> On 8/22/07, Grégoire Cachet <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I would like to get the class name from a relation name (OneToOne)
> ..
On 8/22/07, Grégoire Cachet <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to get the class name from a relation name (OneToOne)
...
> I want to get the class of the object a.modelb (ie ModelB) without
> instanciating a ModelA. Is there a clever way to get it from the model
> definition ? or do
Hi,
I would like to get the class name from a relation name (OneToOne)
For example :
class ModelA(models.Model):
label = models.CharField(max_length=255)
class ModelB(models.Model):
a = models.OneToOneField(ModelA)
class ModelC(models.Model):
a = models.OneToOneField(ModelA)
If I
3 matches
Mail list logo