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 1.8 #1060
Django 1.8 #1060
Conversation
74bb087
to
45489d6
Compare
I think it's worth trying to get this into 0.9. Django 1.8 is scheduled for the end of this month and 1.0 might be a long wait. |
I agree. How much work do you think it is? Could someone else help? On Tuesday, 17 March 2015, Karl Hobley notifications@github.com wrote:
sent from my phone |
The work on getting Wagtail working on Django 1.8 is mostly done. Mainly waiting on the following PRs to be merged:
Reviews much appreciated! We also need to think about how we're going to get |
@@ -6,7 +6,7 @@ | |||
from six import text_type | |||
|
|||
from modelcluster.forms import ClusterForm, ClusterFormMetaclass | |||
|
|||
from modelcluster.models import get_related_model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would probably be best to redefine this in wagtail so an older version of modelcluster can still be used under Django 1.7
I tried to combine Django 1.8 (rc1), Wagtail, and Jinja templates, and came across a problem: Jinja templates fail when the context contains a |
58e4b0e
to
4416529
Compare
@timheap thanks for testing! |
6671217
to
faa1d03
Compare
Just noticed that the Django ticket @timheap references is now marked wontfix because Tim has found that |
447c5bf
to
4b5895c
Compare
Hi @timheap, please could you review this. Django 1.8 is due to be released tomorrow, and we're keen to get support into Wagtail 1.0. Thanks! |
This looks good! I am keen to see Wagtail in Django 1.8. Wagtail 1.0 will be huge at this rate! Some thoughts on this pull request:
Feature detection seems to be used in many places, as opposed to version detection. In my opinion, this makes the code much harder to read and reason about, as well as hiding the true intention of the code behind comments. For example def get_related_model(rel):
# In Django 1.7 and under, the related model is accessed by doing: rel.model
# This was renamed in Django 1.8 to rel.related_model. rel.model now returns
# the base model.
return getattr(rel, 'related_model', rel.model) and # Django 1.8+
if hasattr(used_template, 'template'):
used_template = used_template.template In my opinion, checking the version is much clearer, straight forward, less error prone, and more explicit: def get_related_model(rel):
# In Django 1.7 and under, the related model is accessed by doing: rel.model
# This was renamed in Django 1.8 to rel.related_model.
if DJANGO_VERSION < (1, 8):
return rel.model
else:
return rel.related_model if DJANGO_VERSION >= (1, 8):
used_template = used_template.template This has the added benefit of being self documenting, as it is clear that the functionality differs from version to version. It also works in all cases, and is already in use where feature detection does not work (e.g. migrations involving content types: I did not review the pull requests for django-taggit and django-modelcluster. |
Yeah.. Unfortunately, the more we make Travis do the slower it gets. We're testing all the database backends on Python 3.4, but just Postgres on Python 2.7.
Maybe I'll just include them for the Django 1.8 tests for now and test Django 1.7 with released versions.
That looks better, will change |
This may require some tweaks now that the API is merged |
Ready for merge. There's still a load of deprecation warnings, I'll solve those in another PR. |
Django taggit |
e9415c5
to
ca993ee
Compare
Otherwise, Django sees it as unsaved and doesn't allow any foreign keys to point to it
To work around differences in AbstractBaseUser in Django 1.7/1.8
Fixtures are now loaded in setUpClass so we must make sure it gets called
This PR adds Django 1.8 support into Wagtail