hi. i've got a model like this:
class Inventory(models.Model):
barcode = models.PositiveIntegerField(unique=True)
parent = models.ForeignKey('self', to_field='barcode', blank=True,
null=True)
name = models.CharField(blank=False)
and i get:
>>> i = Inventory.objects.get(barcode=115716)
>>> i
<Inventory: Apple Mighty Mouse>
>>> i.parent
<Inventory: Apple iMac>
which is fine. whereas in the admin the select-widget will have the
item selected whose id accidentally matches the barcode. i.e. the
values in the select-widget aren't the values from barcode but the pk.
<option value="247">Apple Mighty Mouse</option>
i couldn't find this behaviour in the admin documented anywhere.
so, is the bug in my model, the lack of documentation or the admin?
many thanks in advance.
cheers. chr
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---