-
Notifications
You must be signed in to change notification settings - Fork 12
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
67 changed files
with
1,585 additions
and
497 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from django.contrib.gis import admin | ||
|
||
from boranga.admin import DeleteProtectedModelAdmin | ||
from boranga.components.main.models import UserSystemSettings, FileExtensionWhitelist, Document | ||
from django.apps import apps | ||
from django import forms | ||
|
||
class UserSystemSettingsAdmin(admin.ModelAdmin): | ||
list_display = ["user", "area_of_interest"] | ||
|
||
class ModelForm(forms.ModelForm): | ||
choices = (("all","all",),) + tuple( | ||
map(lambda m: (m,m), filter(lambda m: Document in apps.get_app_config('boranga').models[m].__bases__, apps.get_app_config('boranga').models)) | ||
) | ||
|
||
model = forms.ChoiceField(choices=choices) | ||
|
||
class FileExtensionWhitelistAdmin(DeleteProtectedModelAdmin): | ||
fields = ("name","model","compressed",) | ||
list_display = ("name","model","compressed",) | ||
form = ModelForm | ||
|
||
admin.site.register(FileExtensionWhitelist, FileExtensionWhitelistAdmin) | ||
admin.site.register(UserSystemSettings, UserSystemSettingsAdmin) |
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
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
Oops, something went wrong.