1.4 compatibility + 1.3 backward compatibility #1161

Merged
merged 6 commits into from Jun 8, 2012

Conversation

Projects
None yet
8 participants

noelbush commented Feb 2, 2012

(I made this pull request a couple of days ago, but I stupidly sent it to my own fork, instead of the divio repo. And then I wondered why nobody replied.....)

These changes now seem to work with 1.4, and also preserve 1.3 backward compatibility. I ran ./runtests.sh and corrected the problems that exposed. test_po_sanity fails with this code, but it also fails with the current develop branch. I hope this is useful.

cms/admin/change_list.py
@@ -70,7 +70,10 @@ def __init__(self, request, *args, **kwargs):
def get_query_set(self, request=None):
if COPY_VAR in self.params:
del self.params[COPY_VAR]
- qs = super(CMSChangeList, self).get_query_set().drafts()
+ if 'request' in ChangeList.get_query_set.func_code.co_varnames: # django 1.4
@GotenXiao

GotenXiao Feb 7, 2012

Contributor

Is this really necessary? Couldn't we just use if django.VERSION >= (1, 4): instead?

@noelbush

noelbush Feb 7, 2012

That sounds good to me. I was just following the practice I saw elsewhere.

cms/admin/pageadmin.py
@@ -640,8 +642,12 @@ def changelist_view(self, request, extra_context=None):
raise PermissionDenied
try:
if hasattr(self, 'list_editable'):# django 1.1
@kezabelle

kezabelle Feb 7, 2012

Contributor

This might be the appropriate time to get rid of the if 1.1 else 1.0.2 logic, as neither version is supported any more as far as I know, and ojii didn't object in #1111.

I have updated the version checking as suggested in previous comments, and I have verified that all tests pass with the Django 1.4 beta 1 (EXCEPT for the previously mentioned test_po_sanity).

noelbush commented Apr 2, 2012

All tests pass with the officially released Django 1.4

tback commented Apr 6, 2012

I just checked out your django_1.4_compatibility branch and tried running the tests. I get 139 errors when running the tests against 1.4. I can confirm that all tests pass against django 1.3

Here is what I did:
First I provided a buildout django-14.cfg. (I copied django-13.cfg and updated the django version)
Then I ran the tests:
$ ./runtest.sh -d 14 -> 139 errors

$ ./runtest.sh -d 13 -> OK

Thanks -- yes, I see that too now. I somehow thought that just by having
1.4 installed in the environment, the tests were running against it.

However, I guess the good news is that the vast majority of errors seem to
be:

ImproperlyConfigured: Module "django.core.context_processors" does not
define a "auth" callable request processor

...which looks like something simple enough to address.

On Fri, Apr 6, 2012 at 13:49, tback <
reply@reply.github.com

wrote:

I just checked out your django_1.4_compatibility branch and tried running
the tests. I get 139 errors when running the tests against 1.4. I can
confirm that all tests pass against django 1.3

Here is what I did:
First I provided a buildout django-14.cfg. (I copied django-13.cfg and
updated the django version)
Then I ran the tests:
$ ./runtest.sh -d 14 -> 139 errors

$ ./runtest.sh -d 13 -> OK


Reply to this email directly or view it on GitHub:
#1161 (comment)

tback commented Apr 10, 2012

Noel, you're right the majority is the context processors.

I've brought it down to 3 errors and 2 failures through some minor changes and through the adaption to reversion 1.6. Now I am kinda lost and looking for pointers. I'd highly appreciate if someone could look through it

A word of caution: I am quite new to django-cms and don't really know what I am doing. I am unsure which admin URLs are correct (example.org/en/admin/... or example.org/admin/...) and the adaption to reversion 1.6 isn't completed. The tests look OK, but I've yet to look at the results on a testserver.

https://github.com/tback/django-cms/tree/django_1.4_compatibility/here_be_dragons

@ojii ojii referenced this pull request May 23, 2012

Closed

1.4 support - meta ticket #1228

@beniwohli beniwohli merged commit 78638dd into divio:develop Jun 8, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment