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
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
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
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
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
5 matches
Mail list logo