llazzaro / django-scheduler-sample

Example application of django-scheduler
78 stars 76 forks source link

Shell giving error with Events.objects.all() using python3.4 in virtualenv #11

Closed gabn88 closed 8 years ago

gabn88 commented 8 years ago

Event.objects.all() Traceback (most recent call last): File "", line 1, in File "/home/Desktop/test_django_scheduler/django-scheduler-sample-master/lib/python3.4/site-packages/django/db/models/query.py", line 141, in repr return repr(data) File "/home/Desktop/test_django_scheduler/django-scheduler-sample-master/lib/python3.4/site-packages/django/db/models/base.py", line 496, in repr u = six.text_type(self) File "/home/Desktop/test_django_scheduler/django-scheduler-sample-master/src/django-scheduler/schedule/models/events.py", line 61, in str 'start': date(self.start, django_settings.DATE_FORMAT), File "/home/Desktop/test_django_scheduler/django-scheduler-sample-master/lib/python3.4/site-packages/django/template/defaultfilters.py", line 771, in date return formats.date_format(value, arg) File "/home/Desktop/test_django_scheduler/django-scheduler-sample-master/lib/python3.4/site-packages/django/utils/formats.py", line 136, in date_format return dateformat.format(value, get_format(format or 'DATE_FORMAT', use_l10n=use_l10n)) File "/home/Desktop/test_django_scheduler/django-scheduler-sample-master/lib/python3.4/site-packages/django/utils/formats.py", line 110, in get_format for module in get_format_modules(lang): File "/home/Desktop/test_django_scheduler/django-scheduler-sample-master/lib/python3.4/site-packages/django/utils/formats.py", line 82, in get_format_modules modules = _format_modules_cache.setdefault(lang, list(iter_format_modules(lang, settings.FORMAT_MODULE_PATH))) File "/home/Desktop/test_django_scheduler/django-scheduler-sample-master/lib/python3.4/site-packages/django/utils/formats.py", line 51, in iter_format_modules if not check_for_language(lang): File "/home/Desktop/test_django_scheduler/django-scheduler-sample-master/lib/python3.4/site-packages/django/utils/translation/init.py", line 181, in check_for_language return _trans.check_for_language(lang_code) File "/home/Desktop/test_django_scheduler/django-scheduler-sample-master/lib/python3.4/functools.py", line 472, in wrapper result = user_function(_args, *_kwds) File "/home/Desktop/test_django_scheduler/django-scheduler-sample-master/lib/python3.4/site-packages/django/utils/translation/trans_real.py", line 409, in check_for_language if not language_code_re.search(lang_code): TypeError: expected string or buffer

gabn88 commented 8 years ago

Seems to be a problem with the Event string method:

def __str__(self):
    return ugettext('%(title)s: %(start)s - %(end)s') % {
        'title': self.title,
        'start': date(self.start, django_settings.DATE_FORMAT),
        'end': date(self.end, django_settings.DATE_FORMAT),
    }

Or something with the language settings?

gabn88 commented 8 years ago

Issue seems to be resolved in Django 1.8.8!