Re: How to register EmployeeAdmin using atributes in Person class

2011-04-24 Thread Ernesto Guevara
I still having a little problem using OneToOne relationship and Edit form. The forms are created with combobox and get all address in database, i need the address of the specific Employee only. Anybody know fix this problem? Thanks! 2011/4/23 Guevara > I got put in the form of employee the for

Re: How to register EmployeeAdmin using atributes in Person class

2011-04-23 Thread Guevara
I got put in the form of employee the form of Houses using StackedInline: class HouseInline(admin.StackedInline): model = House max_num = 1 class EmployeeAdmin(admin.ModelAdmin): search_fields = ['person__name','person__cpf'] list_display = ("name","cpf","date_born","date_inclusi

Re: How to register EmployeeAdmin using atributes in Person class

2011-04-23 Thread Guevara
Thank you Ramiro! Now i have the atributes Person in form Employee. =) I added the attribute address and house in Employee class: models.py class Employee(Person): person = models.OneToOneField(Person, parent_link=True) # Relationship OneToOne with Address address = models.OneToOneF

Re: How to register EmployeeAdmin using atributes in Person class

2011-04-22 Thread Ramiro Morales
On Fri, Apr 22, 2011 at 11:55 PM, Guevara wrote: > [...] > > class Person(models.Model): >    name = models.CharField(max_length=50) >    date_inclusion = models.DateField() > > class Employee(models.Model): >    person = models.OneToOneField(Pessoa) > > I reed this doc http://docs.djangoproject.c

How to register EmployeeAdmin using atributes in Person class

2011-04-22 Thread Guevara
Hello! I need register EmployeeAdmin using atributes in Person class: My admin.py: class EmployeeAdmin(admin.ModelAdmin): list_display = ("name","date_inclusion") ordering = ["-name"] search_fields = ("name",) list_filter = ("date_inclusion",) list_per_page = 10 admin.site.r