Hi everyone,

I am trying to get to grips with django and so far I find it wonderful!
 But I am stuck on the following problem, which I have tried to make a
test case of below (see models.py).  The problem is that when I try to
add a new parent with some children, then I get an error relating to
the 'toys' field, namely:

    Child' object has no attribute 'set_toys'

But if I remove the edit_inline argument from the 'mum' field in the
'Child' object it works fine. It also works fine if I remove the 'toys'
field from the 'Child' object but keep the edit_inline in the 'mum'
field.

Can I remedy this by changing something (maybe define my own set_toys
methode, but how?) ?
Is there a reason why I shouldn't consider doing things this way?
In short, please enlighten me.

PS: My version of django advertises itself as "Django version 0.95
(post-magic-removal)"

-------------- models.py ---------------
from django.db import models


class Toy(models.Model):
    name = models.CharField(maxlength=20)

    def __str__(self):
        return self.name

    class Admin:
        pass


class Parent(models.Model):
    name = models.CharField(maxlength=20)

    def __str__(self):
        return self.name

    class Admin:
        pass


class Child(models.Model):
    name = models.CharField(maxlength=20, core=True)
    toys = models.ManyToManyField(Toy)
    mum = models.ForeignKey(Parent, edit_inline=models.TABULAR)

    def __str__(self):
        return self.name

    class Admin:
        pass
----------------- end of models.py ------------------

-- 
Arnaud


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to