Sorry to ask a stupid question, but following is my basic model
structure. I want to create a custom manager for a class which has a
foreignKey to another class. And to call that manager function in list
display to display all the related properties.  Am I doing it right? I
don't see any associated fields when I execute the following in shell.
Please help me with this issue, Thanks.



class privateAcctManager(models.Manager):
        def show_acct(self):
                return super(privateAcctManager,
self).get_query_set().select_related()

class privateAcct(models.Model):
    id = models.ForeignKey(Acct)
    obj = privateAcctManager()

    def  all_acct(self):
       return self.obj.show_acct()

     class Meta:
           db_table= 'private_acct'

class PublicAcct(models.Model):
    id = models.ForeignKey(Acct)
     class Meta:
           db_table= 'public_acct'

class Account(models.Model):
   name = models.TextField()
   balance = models.decimalfield()

class PrivateAcctAdmin(admin.modelAdmin):
list_display =( id, all_acct.name , all_acct.balance)



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

Reply via email to