Closed aminbahrabadi closed 4 years ago
@aminbahrabadi please update jdatetime package in your dependencies list
it's fixed in https://github.com/slashmili/python-jalali/pull/62
I still get that error and about jdatetime:
Requirement already up-to-date: jdatetime in c:\users\**\envs\**\lib\site-packages (3.6.2)
I still get this error :(
@smb-h me too!
@aminbahrabadi , @smb-h Thanks for reporting again :). Is it possible for you guys to post your environment information like OS, Python version, Django version, django_jalali version, python-jalali version, and ...
Also, It would be good to create a minimal project with the bug. it would help us to find the problem easier.
Thanks
@hramezani of course. OS Ubuntu 2020.04 lts Python 3.8.2 Django 3.0.2 django-jalali 3.3.0
and the field causing this problem
date_joined = jmodels.jDateTimeField(auto_now_add = True, auto_now = False, verbose_name = _('Created'))
Thank you!
I'm still getting the error
django-jalali==3.3.0 jdatetime==3.6.2
I still have this problem:
Django 3.0.7
django-jalali 3.4.0
jdatetime 3.6.2
I have this field in my model:
timeStamp = jmodels.jDateTimeField(default=jdatetime.datetime.now, editable=False)
and because timeStamp tzinfo is not set automatically I have to set it in save method manually:
def save(self, *args, **kwargs):
if not is_aware(self.timeStamp):
self.timeStamp = make_aware(self.timeStamp)
super(Post, self).save(*args, **kwargs)
this works perfectly and doesn't bother but when I'm updating my model it gives:
TypeError: utcoffset(dt) argument must be a datetime instance or None, not datetime
steps to create:
instance = Model.objects.get(id=?)
instance.save() ==> makes error
Hi @usefss, Thanks for reporting the problem. The https://github.com/slashmili/django-jalali/pull/108 fixes this problem. we need time to check the PR and merge it. Then we will prepare a release for it.
django-jalali 4.0.0
is out https://pypi.org/project/django-jalali/4.0.0/
Thanks @slashmili :+1:
Thanks for your great work @hramezani 👏
I'm closing this ticket for now, feel free to open it if you still have the same issue
Recently when I create a jDateTimeField, this error appears:
The error seems to be here: