Suche nach Alias (Fahrtenname)
This commit is contained in:
@@ -51,7 +51,7 @@ class MediumInline(admin.TabularInline):
|
||||
@admin.register(Person)
|
||||
class PersonAdmin(admin.ModelAdmin):
|
||||
list_display = Person.list_display
|
||||
search_fields = ('name', 'full_name', 'name_native', 'birth_name')
|
||||
search_fields = ('name', 'full_name', 'name_native', 'birth_name', 'identity__alias')
|
||||
list_editable = ('details_secret',)
|
||||
inlines = [
|
||||
IdentityInline,
|
||||
|
||||
@@ -47,13 +47,17 @@ class Person(models.Model):
|
||||
#help_text='',
|
||||
)
|
||||
contacts = GenericRelation('Contact')
|
||||
def alias(self):
|
||||
return ','.join(n.alias for n in self.identity_set.all())
|
||||
alias.verbose_name = 'Aliase'
|
||||
alias.help_text = 'Fahrten-/Spitznamen einer Person'
|
||||
|
||||
class Meta:
|
||||
verbose_name = 'Person'
|
||||
verbose_name_plural = 'Personen'
|
||||
ordering = ['name','birth_year']
|
||||
|
||||
list_display = ['name', 'full_name', 'details_secret', 'birth_year']
|
||||
list_display = ['name', 'alias', 'full_name', 'details_secret', 'birth_year']
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
Reference in New Issue
Block a user