Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 March 10, 2008 16:56:31

Pete C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Problems using mptt


Are you using 0.96 (you're using __str__ so I'd guess you are)?
Django's ugettext was introduced in the unicode merge that occured
after 0.96's release.

On Mar 10, 12:18 am, Tim Adler <> wrote:
> Hey everybody,
>
> I'm trying to added mptt to my django project for managing a simple
> page-tree. It doesn't seem to work, as it is supposed too.
>
> My model looks like this:
>
> from django.db import models
> import mptt
>
> class Page(models.Model):
>         title = models.CharField(maxlength=200)
>         body = models.TextField()
>         parent = models.ForeignKey('self', null=True, blank=True,
> related_name='pages')
>
>         class Meta:
>                 ordering =
>
>         class Admin:
>                 pass
>
>         def __str__(self):
>                 indent = ""
>                 for i in range(self.lvl()):
>                         indent += "-"
>
>                 return '%s %s' % (indent,self.title)
>
>         def level(self):
>                 if(self.parent == None):
>                         return 0
>                 else:
>                         return self.parent.lvl() + 1;
>
> But even in this stage, without the mptt.register, my development
> server gives me a
>
> > Validating models...
> > djangotree.content: cannot import name ugettext
> > 1 error found.
>
> I guess that is related to the mptt, but I have no idea, what might be
> causing this.
> Can somebody help out?
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support