-
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
Django 2.0 support #344
Comments
Hello! You are perfectly right, it's not compatible right now. No ETA yet, but I push this to the top of my list. Thanks for reminding me! |
For information, this is due to this Django commit: django/django@66933a6 |
Okay, it seems we reached a turning point in hvad history.
Thus the dilemma I now face: should I spend lengthy hours fixing hvad1 compatibility, or should I release hvad2 despite it being incomplete? Would you be willing to try hvad2 in its current state? You may install it through Most notable changes from hvad 1 are:
|
I have been looking some more, the ramifications of Django 2 changes run even deeper than I thought. This means given the little time I have, making hvad1 work with Django2 is close to unfeasible without some external contribution. So I guess I'm heading towards this approach:
I am worried because the change is somewhat disruptive to existing code bases. |
I guess you're going to merge the hvad2 branch into master soon? Are they blocker to make a pre-release? |
Hello, It's a good question, I am still worried it is not as polished I wished it to be. Yet I don't have time to work on it at the moment. Perhaps a good compromise would be releasing it as is and tagging it as an alpha release. As for points that still need work:
Won't make it to v2: most of #249. Those were the actual reasons the refactor was initiated for, so it's a pity they won't make it. But the refactor in itself brings many improvements to the core, most notably the change to actual join filters instead of regular filters. At least this will lay the ground that will allow those things to be added incrementally at a later point. |
Yes, I think that with a pre-release you'll more likely get the expected reports for corner cases… |
I tried the dev/hvad2 branch with Django 2.0, but still got an error: Any idea? |
Hello, I am getting an assertion error |
Hi @spectras . I'm updating a big app to the latest Django. We are deciding which way to take for translations given that hvad doesn't support Dango>=2 yet. Could you please explain us what the current status is? Both for the master branch and the hvad2 branch. We might put in the work to finish hvad2 but we need some guidance. #273 talks about some design decisions needed and corner cases. Where can I read about these? |
Hey @rasca: I fixed the tests for django 2.1 postgres on https://github.com/tback/django-hvad/tree/dev/hvad2 . I don't know if that works or where it will take me, I just thought you might be interested in any work that is going on. |
Hi @spectras I just started updating several apps of mine to Django 2, most of them using hvad, all of them with a lot of translated data but I'm getting to the same dead end as others, hvad not supporting Django 2... Can you tell us about the current status? And is an update to "hvadDjango2Compatible" possible without loosing data? Thank you very much! |
Hello everyone, I am really sorry hvad has gotten out of focus lately. As a matter of fact, maintaining hvad as django changes is quite some work, and I got discouraged by the sheer amount of things that broke with Django 2.0. Especially as I had hvad almost working with the beta release, and multiple breaking changes were added right before the final release, at a time I had no free time at all. Now, I understand many large and smaller projects depend on hvad and I don't want hvad to be yet another argument against open-source dependencies. Here is what I intend to do:
Thanks for bearing the lack of news. I will look what people posted here and the other issues, especially @tback 's passing tests, which look really promising. Also, if someone is interested in stepping up and becoming an official hvad maintainer, there is definitely a gap to fill :) |
Good news, I have a version that passes all tests on Django 2.1 on mysql, postgres and sqlite. As it turns out, the errors were scary, but they stemmed from a smaller-than-expected number of roots. Always frustrating when so many hours end up in so little actual changes in the code. As hvad2.0 introduces breaking changes in the API, I need to write up on those. So it is unlikely I can release today, but expect it within the upcoming week. |
@spectras When will you release new stable version? I saw that you released a beta version. But I'm not sure that is it works correctly. Do you think should I wait for the stable version? |
I tested the beta version. When I try to use
i think, it related to the Django serializers. i got the same error.
Very Hacky Solution: https://github.com/django/django/blob/master/django/core/serializers/python.py#L59 if you add following code in the else condition it works;
|
Hello, the beta version is a release, I keep it beta precisely so people can test it and provide feedback, just like you did. I'll mark it as stable if it goes without issues for long enough. By the way, if you could repost that exact message as a separate issue, it would be great! |
Also, I faced with a different bug. When I try to add a new model, I got the following error while generating migrations.
Debugging Data:
Django Version:
|
I found that same bug when rebuilding all migrations from scratch. No solution but a workaround:
This worked for me, hope it helps others too. I found no time for further debugging. Maybe good to know that in the models I use RichTextFields and Taggit tags, there might be a compatibility issue because I found this error on the taggit project: jazzband/django-taggit#206 Hope this helps debugging and thanks for HVAD! |
Python 3.6.3
and
|
Any progress on this one? |
Removing the I'm not sure what the In Django 2.1 the Where can I find the latest repo/branch for Django 2? The |
Hello @kcleong . Could you please share link to your own fork? |
@DmytroLitvinov, thanks for the pointer to the Django 2.x branch. This is the fork I am using PythonUnited/django-hvad |
I like django-hvad a lot, it works amazingly with RESTful API but the recent Django 2.0 upgrading in our project really brings some operation issues. For others use a lot of RESTful API and want to stay with hvad's awesome serializer, try to avoid using this is a temporary fix till the official hvad 2.0, cheers |
@silau2005 Your article saved me. What a beautiful short-term solution. 多谢你!真没想到django-hvad到现在还没更新过。 |
@silau2005 the link is broken... and I would need so much to see how I can avoid using .language call... Can you point me to another link or something.. :D thx! |
@mroobert I just fixed the link, you might check it again. Wish it helps. Let me know your result. cheers |
@silau2005 thx <3, now the link is working One more question... when you use this type of code to avoid the .language call :
and after that you pass the queryTranslations to the serializer:
This is triggering an error in serializer.data ===> /hvad/utils.py", line 70, in load_translation It is this the right way of using the serializer if you're avoiding .language call.. or ? The serializer:
The model:
|
I will talk a little bit about this exception
and the serializer you are using is LocalizedStringSerializer, while the model/queryTranslations you put into the serializer is from translations_model so they don't match each other my suggestion is to modify queryset = LocalizedString.objects.filter(namespace__title=pk)
queryTranslations = LocalizedString.translations.field.model.objects.filter(language_code=lang, master__in=queryset)
#serializer = LocalizedStringSerializer(queryTranslations, many=True)
#strings = {d['key']: d['value'] for d in serializer.data}
#v1 = queryset.objects.values()
#v2 = queryTranslations.objects.values()
#fields = queryset.model._meta.fields
#fieldsTranslations = queryTranslations..model._meta.fields you could construct the dictionary from queryset and queryTranslations checking would be needed if the result should be a single dictionary instead of multiple dict from the querysey wish the information helps, I don't have time to do deep investigation, good luck! |
It won't take long before Django 2.0 is released which is currently in beta. I've tried out HVAD with it and it doesn't seem compatible, at least not the admin part; I seem to be getting this error on a list overview:
_clone() got an unexpected keyword argument '_forced_unique_fields'
It would be nice if I could continue using HVAD after upgrading to 2.0 once it gets released.
The text was updated successfully, but these errors were encountered: