-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from .contact import ContactAdmin | ||
from .location import LocationAdmin | ||
from .organisation import NeighbourhoodAmin, OrganisationAdmin, OrganisationTypeAdmin | ||
|
||
__all__ = [ | ||
"ContactAdmin", | ||
"LocationAdmin", | ||
"OrganisationAdmin", | ||
"OrganisationTypeAdmin", | ||
"NeighbourhoodAmin", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django.contrib import admin | ||
|
||
from ..models import Contact | ||
|
||
|
||
@admin.register(Contact) | ||
class ContactAdmin(admin.ModelAdmin): | ||
list_display = ("organisation", "last_name", "first_name") | ||
list_filter = ("organisation",) | ||
search_fields = ("first_name", "last_name") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django.contrib import admin | ||
|
||
from ..models import Location | ||
|
||
|
||
@admin.register(Location) | ||
class LocationAdmin(admin.ModelAdmin): | ||
list_display = ("name", "city", "postcode", "street", "house_number") | ||
list_filter = ("city",) | ||
search_fields = ("name", "city") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from django.contrib import admin | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from ..models import Neighbourhood, Organisation, OrganisationType | ||
|
||
|
||
@admin.register(Organisation) | ||
class OrganisationAdmin(admin.ModelAdmin): | ||
# List | ||
list_display = ("name", "type") | ||
list_filter = ("type__name", "city") | ||
search_fields = ("name",) | ||
ordering = ("name",) | ||
prepopulated_fields = {"slug": ("name",)} | ||
|
||
# Detail | ||
fieldsets = ( | ||
( | ||
None, | ||
{"fields": ("published", "name", "slug", "type", "logo", "neighbourhood")}, | ||
), | ||
(_("Contact"), {"fields": ("email", "phone_number")}), | ||
( | ||
_("Address"), | ||
{"fields": ("street", "house_number", "postcode", "city")}, | ||
), | ||
) | ||
|
||
|
||
@admin.register(OrganisationType) | ||
class OrganisationTypeAdmin(admin.ModelAdmin): | ||
list_display = ("name",) | ||
|
||
|
||
@admin.register(Neighbourhood) | ||
class NeighbourhoodAmin(admin.ModelAdmin): | ||
list_display = ("name",) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters