Decide: should the declaration check follow code in a mixin that sets path or default?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Read ADR 0021 Decision 2 and the declaration check, _path_from_module, and import_models paths referenced in the issue. Compare the six reproduced cases and decide how far the check should follow mixin, metaclass, and post-definition behavior. Done means documenting a clear scope decision for which cases the declaration check will reject or leave out of scope.
Written by the indexing model from the issue text.
Description
The closed namespace (ADR 0021 Decision 2) reads the public names a config class and its mixins hold. Code in a mixin can still give a declaring class a path or default it never wrote, and nothing refuses it. This was found while settling #59. Each case below was reproduced on release/0.1.0a2, and each ends with a declaring class that has a snapshot:
- A mixin overrides
_path_from_module. Private names are admitted, and Django calls that method to derivepath. - A mixin defines
__getattr__that answerspath, or an__init__that setsself.path. Django'shasattr(self, "path")then finds it. - A mixin's
__init_subclass__setscls.pathorcls.defaultaftersuper().__init_subclass__(), so after the check has run. - The same hook sets them before
super(), and_checkthen reads them as written in the declaring class's own body. pathordefaultis rebound on a mixin after the class is defined.import_modelschecks onlynameandlabelagain.- A metaclass property for
defaulton a base class hides the declaring class's owndefault.
A decision is needed on how far the check should follow code rather than attributes. Possible directions are refusing dunder hooks other than ready in a mixin, refusing a metaclass, and checking path and default in import_models too. Leaving these out of scope is also possible, since each case takes deliberate code.
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- Avg merge
- 5h 30m
- Merged PRs (30d)
- 85
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stack314/django-neolith
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
stack314/django-neolith#142 · 1 comment ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
stack314/django-neolith#141 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
stack314/django-neolith#140 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
stack314/django-neolith#126 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
stack314/django-neolith#119 · 2 comments ·
Maintainers usually reply within 1 day
All issues in stack314/django-neolith
Similar issues
-
automated endpoint-dead needs-curation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
almanac-data/climate-almanac#138 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
OceanDataTools/openrvdas#760 ·
Maintainers usually reply within 1 day
-
level/subtask type/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
wazuh/wazuh-virtual-machines#1091 ·
Maintainers usually reply within 1 day
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentPossibly taken @halcyon-past claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/semantic-kernel#14824 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
LedgerHQ/app-bitcoin-legacy#306 ·