Open pawelad opened 1 year ago
Hi Pawel! - Thank you for linking this. My reading is that there are three points of incompatibility:
ssort
moves class Meta
above database field definitions and custom manager attributes.ssort
splits d'under methods into lifecycle and other, whereas django lumps them all into "Any custom methods".ssort
does not enforce the order of str
, save
, or get_absolute_url
.(Am I missing anything else?)
I think that we are unlikely to change 2 and 3. I'm quite happy with the current d'under sorting, and hard-coding non-special method names is likely to lead to confusion.
Changing 1 would be a significant break in compatibility, but I agree that putting classes under attributes does look better and it would be consistent with both the django and pydantic docs. I might consider it for the 1.0 release.
Sorry for the late reply!
I think you summed up the problem really well and I agree with all your points.
Would you be open to implementing the "nested classes after attributes" and maybe hiding it behind a feature flag? You could then decide if you want that to be the default from v1 or it it would stay configurable.
Let me know if I can help in any way.
Hi!
I really like the idea behind this library and think it could complement
black
,isort
(andruff
) really well : )Unfortunately, I can't use it on any Django projects because the enforced order is not compatible with Django's coding style:
Would you be open to supporting it, either automatically (for example when
django
usage is found and inheritance frommodels.Model
is detected) or possibly via some kind of--profile
argument (similarly to howisort
supportsblack
profile)?