hotkit / django-async

A simple asynchronous execution Django application with proper database transaction management
http://www.kirit.com/Django%20Async
Boost Software License 1.0
35 stars 20 forks source link

Using django inbuilt now() function on timezone to support v1.4 #3

Closed pbrooks closed 10 years ago

pbrooks commented 11 years ago

Removes warnings when using flush_queue about not taking in account of timezone support is active.

Using django.utils.timezone is fully backwards compatible if a project doesn't have USE_TZ enabled.

KayEss commented 11 years ago

Hi Peter,

I've tried to incorporate your changes into the latest develop branch. I've added a Django 1.4 test project to the test run and updated your patch so it works with the Django 1.3 tests too. So far all good.

The problem is that the Django 1.4 tests only pass with USE_TZ = False. When it's set to True there are a number of warnings printed and one hard error where a parsed date is checked. You'll find the code in the feature/tz branch.

I still think this version is probably better than the previous one (and hence worth pushing to pypi as a new version), but would appreciate a second opinion.

pbrooks commented 11 years ago

Hi KayEss, I'll run up the same tests, the active project I've been using this code in has been 1.4 with USE_TZ enabled. Do you want to add the django_1_4 into the repo from test-projects?

KayEss commented 11 years ago

Thinking about this a bit more I suspect that the problem is caused by another project, django-slumber, which also doesn't use the new 1.4 time zone features. I'm going to have a look at that, but I have a nasty feeling it's going to be harder to get right. In the meantime I think I'll push a newer version of this project.

KayEss commented 10 years ago

This is now in the develop branch so will be included in the next release, which should be soon. We're just testing the new job grouping facilities properly.