My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 54: MPTT not working with Django 1.0.2?
1 person starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Sep 2010


 
Reported by whenther...@gmail.com, Jul 10, 2009
Here's my model that uses mptt:

class Discipline(models.Model):
    discipline = models.CharField(max_length=50,)
    information = models.TextField()
    
    def __unicode__(self):
        return self.discipline

mptt.register(Discipline)

I reset my app and syncdb'd, then started the django shell and imported my
models. When I try this...

physics = Discipline(discipline='Physics', information='whatever')
physics.insert_at(None)
Discipline.objects.all()

I get an empty list. Am I missing something?

I also tried adding through the django admin interface. When I try to save
a test discipline, it gives the error "'Discipline' object has no attribute
'parent'"

Any ideas?

What version of the product are you using? On what operating system?
Django 1.0.2
django-mptt SVN checked out earlier today (I deleted it from site-packages
and reinstalled so I know it's not old)
Windows Vista 64 bit
I'm using the django dev server and mysql
Sep 18, 2009
#1 skylar.s...@gmail.com
I do believe that the default field for mptt is parent otherwise you will need to add
some metadata?
Sep 3, 2010
Project Member #2 craig.ds@gmail.com
1 - physics.save()
2 - You need to define a parent field on your model

These both seem to be working, closing
Status: Invalid

Powered by Google Project Hosting