I had an inline AdminModel that I was ordering by the id of a foreign key 
value, e.g.,

class ThingAdmin(admin.TabularInline):
    model = models.Thing
    ordering = ('rel_id',)

Where "rel_id" references the actual db column vs the object "rel".

This worked like a charm in the admin interface, but when I tried to 
generate migration scripts it raised an error:

The value of 'ordering' refers to 'rel_id', which is not an attribute of 
> 'app.Thing'.


Seems like django should allow me to reference 'rel_id' instead of 'rel' in 
this interface. Would this be considered a bug?

Btw, switching it to `ordering = ('rel',)` worked just fine and appeared to 
still be ordering by the actual id.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5d4aad67-8c59-4b3a-9ddb-318131e8eec5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to