-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better Integration with django-mptt
#246
Comments
Hello, Well, it seems unwise to blindly copy unknown third-party module's properties into another model. It might work, it might break other modules, or it might even corrupt the database. You can do it on a case-by-case basis, just like you did (I can tell you that Interaction between queryset-redefining apps is not clearly defined by Django, which makes it a bit random. It happens to work pretty well with MPTT because what they change in the queryset happens to be mostly compatible with what hvad does with it (with some edge cases like you just found). I guess this specific case could deserve a compatibility package, or maybe creating some |
You're absolutely right, but I wasn't proposing (wouldn't want) more than improved/better |
I'd surely love that too. If you (or any people stumbling upon this) happen to be interested, here is what would be required for such a feature to make it into hvad:
|
django-mptt
django-mptt
Note: there will be some time until hvad2 is released, but compatibility with third-party modules should be improved a lot, and make this kind of issues moot. |
I have read this (http://django-hvad.readthedocs.org/en/latest/public/faq.html#how-do-i-use-hvad-with-mptt).
I have models (see below). Admin works, ORM works.
I want now to use the those models in forms and make use of the
django-mptt
fields.https://django-mptt.github.io/django-mptt/forms.html#fields
For instance, the
TreeNodeMultipleChoiceField
.When feeding the queryset to the
TreeNodeMultipleChoiceField
, I get errors.Applying this hack helps:
I'm not sure if
django-hvad
is supposed to go that far, but perhaps some copying some essential properties of the original model into translated model could be automatised or the workarounds documented.The text was updated successfully, but these errors were encountered: