Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 March 10, 2008 01:19:04

Tim A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Problems using mptt


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 11th 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