If I have a class Catalog which relates to a class Product... in the  
admin interface I'd like to specify a function (to be used to  
navigate to related products) rather than a field... like this...

class Catalog(models.Model):
        name = models.CharField(maxlength=200, core=True,  db_index=True,  
default='')
        fk_site = models.ForeignKey(Site, to_field='id')
        products  = models.ManyToManyField(MetaCategory)

        def get_prods(self=None):
                if self:
                        return Product.objects.filter(catalog=self.name)

        class Admin:
                fields = (
                (None, {'fields': ('name',)}),
                ('Site', {'fields': ('fk_site',)}),
                ('Products', {'fields': ('get_prods',)}),
            )

... then when editing a Catalog I'd have a non-editable list of  
Products that I could navigate to...

thanks

tom

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to