Closed pedrovhb closed 2 years ago
Merging #103 (c8bdcaf) into master (3787308) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #103 +/- ##
=======================================
Coverage 88.37% 88.37%
=======================================
Files 6 6
Lines 215 215
=======================================
Hits 190 190
Misses 25 25
Impacted Files | Coverage Δ | |
---|---|---|
massadmin/massadmin.py | 86.63% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 3787308...c8bdcaf. Read the comment docs.
@pedrovhb Looks very nice. Thank you very much.
@PetrDlouhy happy to contribute!
@bufke I'm not familiar with how release cycles work for the library, is there anything I can expect in terms of a timeline for a public PyPI release? No pressure at all, just to know what to plan for :)
Hello! First off, thanks for the library, it's quite useful :slightly_smiling_face:
This PR aims to change forms so that they use the admin_obj's
get_fieldsets
,get_prepopulated_fields
, andget_readonly_fields
.Currently, behavior is inconsistent with regards to these fields (I'll be using fieldsets as an example but the same applies to both other methods). As a refresher, defining
fieldsets
in a model admin makes the page use the provided fieldsets; implementingget_fieldsets
uses the return value from that, instead. The non-overridden behavior ofget_fieldsets
is to just returnfieldsets
.In massadmin, non-function attributes are copied over in
get_overrided_properties
, so definingfieldsets
will use the copied attribute and work as expected. However, since the method called isMassAdmin.get_fieldsets
, we always get the non-overridden behavior of just usingfieldsets
, and the model admin'sget_fieldsets
is ignored.If we use
self.admin_obj.get_fieldsets
instead ofself.get_fieldsets
, then we get the expected overriden call if it is defined by the model admin class, and the default (current) behavior if it is not.Thanks!
cc @PetrDlouhy