Hello Malcoml. Here the copy and paste of the error: FieldDoesNotExist at /animallib/
Section has no field named 'self' Request Method: GET Request URL: http://utopia-design.net/animallib/ Exception Type: FieldDoesNotExist Exception Value: Section has no field named 'self' Exception Location: /home/curalouc/django_src/django/db/models/options.py in get_field, line 101 |Traceback (most recent call last): File "/home/curalouc/django_src/django/core/handlers/base.py" in get_response 68. callback, callback_args, callback_kwargs = resolver.resolve(request.path) File "/home/curalouc/django_src/django/core/urlresolvers.py" in resolve 162. sub_match = pattern.resolve(new_path) File "/home/curalouc/django_src/django/core/urlresolvers.py" in resolve 118. return self.callback, args, kwargs File "/home/curalouc/django_src/django/core/urlresolvers.py" in _get_callback 125. self._callback = getattr(__import__(mod_name, {}, {}, ['']), func_name) File "/home/curalouc/django_src/django/db/models/base.py" in __new__ 65. new_class._prepare() File "/home/curalouc/django_src/django/db/models/base.py" in _prepare 177. opts._prepare(cls) File "/home/curalouc/django_src/django/db/models/options.py" in _prepare 63. self.order_with_respect_to = self.get_field(self.order_with_respect_to) File "/home/curalouc/django_src/django/db/models/options.py" in get_field 101. raise FieldDoesNotExist, '%s has no field named %r' % (self.object_name, name) FieldDoesNotExist at /animallib/ Section has no field named 'self' And the model, in raw copy and paste class Section(models.Model): description = models.CharField(verbose_name='Description',maxlength=100) parent = models.ForeignKey('self',related_name='childs',blank=True, null=True) link = models.CharField(verbose_name="Section link",maxlength=300,help_text="The url of the document or custom page that will be shown") position = models.IntegerField(verbose_name="Order of appearence",blank=True, null=True) def __str__(self): return self.description class Admin: list_display = ('description','position') search_fields = ['description'] class Meta: order_with_respect_to = 'self' ordering = ['position','description'] Thanks for your help, 4nderson | Malcolm Tredinnick wrote: > On Mon, 2007-03-26 at 22:41 -0300, Anderson Santos Silva wrote: > >> I am working with the trunk, and I never tried the order_with_respect_to >> before, so I don't know how it works but it's on the official Django's >> documentation. >> Since my model is called Section, it's probably something about Python >> tricks to get a property dinamically. That sounds exciting, my first bug >> found =) >> I googled everything about this and I couldn't find anything similar and >> I don't know where to start to find why this bug happens. But all the >> examples that I found about this property (order_with_respect_to) uses a >> different model, maybe it's a clue. >> > > It may not be a bug. Let's gather some more information first. You said > that when you used "parent" as the attribute in order_with_respect_to, > it gave you an error. Could you please post the full traceback. Like I > said, the fragment you posted doesn't correspond to any place in the > code I can find, so I'd like to see a bit more information about how it > occurred. > > Thanks, > Malcolm > > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---