Conversation
Co-authored-by: Christian Merten <christian@merten.dev>
Co-authored-by: Christian Merten <christian@merten.dev>
|
I checked out which models don't inherit CommonAdminMixin. Those could not be customized. Where useful (in my opinion), i added an inheritance manually (marked with OK) here: |
|
@chrisflav what do you think? currently we don't adapt list views etc. however, this shouldn't be a regular thing anyway as columns that appear in the list view should be quite important…. |
chrisflav
left a comment
There was a problem hiding this comment.
Overall, this looks quite nice. Thanks!
| if custom_included: | ||
| # custom included fields take precedence over exclude | ||
| return custom_included |
There was a problem hiding this comment.
| if custom_included: | |
| # custom included fields take precedence over exclude | |
| return custom_included | |
| if not custom_included is None: | |
| # custom included fields take precedence over exclude | |
| return custom_included |
Otherwise, setting fields = [] will be ignored. Similarly elsewhere.
| # For any other type of field, just call its formfield() method. | ||
| return db_field.formfield(**kwargs) | ||
|
|
||
|
|
||
| def get_included_fields(self): | ||
| """if model has an entire fieldset in settings, return them as list""" | ||
| return settings.CUSTOM_MODEL_FIELDS.get(self.field_key, {}).get("fields", []) |
There was a problem hiding this comment.
| return settings.CUSTOM_MODEL_FIELDS.get(self.field_key, {}).get("fields", []) | |
| return settings.CUSTOM_MODEL_FIELDS.get(self.field_key, {}).get("fields", None) |
Required for the change below. The same should be done for the exclude variant.
| expected_permissions = ( | ||
| 'add_global', 'change_global', 'view_global', 'delete_global', 'list_global', 'view', | ||
| "add_global", | ||
| "change_global", | ||
| "view_global", | ||
| "delete_global", | ||
| "list_global", | ||
| "view", |
There was a problem hiding this comment.
These look like you run some formatting tool. Could you please revert the formatting changes for now so we can do all the formatting changes in one go?
| Customization Guide | ||
| ================= | ||
|
|
||
| This guide explains how to customize the Kompass application using configuration files and templates. | ||
|
|
There was a problem hiding this comment.
Could you please add this guide to the table of contents for the developer manual?
There was a problem hiding this comment.
BTW: the documentation got deployed at https://chrisflav.github.io/kompass/2/merge/development_manual/customization. Unfortunately, I have no idea why it is deployed at this strange url 2/merge instead of MK/conditional_fields.
funktioniert für fieldsets
design-Entscheidung: fields und exclude ist beides möglich, fields überschreibt aber exclude wenn beides vorhanden. fields ist absolut (angegebene custom fields werden angezeigt, egal was in der app angegeben ist, außer im fieldset, da aktuell keine ganze Struktur/Gruppierung angegeben werden kann), exclude ist additiv (zu existierendem exclude in der app)
tests
doku im development manual
implementiert im CommenAdminMixin, daher aktuell nicht auf alle Admins anwendbar—> implementiert als eines FieldCustomizationMixin, was alle Admins einfach erben können.