Hello,
Couple of noob questions:
1.
Is it possible to order the models of my app manually (vs.
alphabetically) when viewing the app page?
See attached "ordering.png".
2.
Relationship models: How can I return different __unicode__ values
based on the relationship that I am viewing.
[code]
class SeasonPlayerRelationship(models.Model):
season = models.ForeignKey('Season')
player = models.ForeignKey('Player')
...
def __unicode__(self):
if self.season:
return 'Season'
else:
return 'Player'
[/code]
See attached "relationship.png".
In the screenshot above, just as an example, I would like "Player" to
get returned, and not "Season".
Optimally, I would like to return nothing for the relationship's
__unicode__, but when I do this:
[code]
def __unicode__(self):
return ''
[/code]
There is just a big gap where a __unicode__ label would appear (I
assume it's because the admin is spitting out an empty or
).
Thanks!
Micky
--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
<><>