The Pendulum README has an example model field class:
https://github.com/sdispater/pendulum#limitations

On Thu, 10 Sep 2020 at 08:22, Roger Gammans <rgamm...@gammascience.co.uk>
wrote:

> On Tue, 2020-09-08 at 18:01 -0700, Damiano Porta wrote:
>
> Hello everybody!
> Can I use Pendolumn (https://pendulum.eustace.io/) as default datetime
> library for my models?
>
>
> You probably want to write a custom DateTimeField subclass and override
> to_python(). Pendolumn date times claim to be stdlib datetimes (eg the doc
> says instance(pendulom_datetime-obj, datetime.datetime) is True ) so
> conversion the other way may work fine with the existing DateTimeField code.
>
> See here:
> https://docs.djangoproject.com/en/3.1/howto/custom-model-fields/#converting-values-to-python-objects
>
> Nb: This is probably a question for the django-users list not the
> django-developers list.
>
> --
>
> Roger Gammans <rgamm...@gammascience.co.uk>
> Gamma Science Ltd. (GB Nr. 07356014 )
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/0874de593ac3d4cdd79a8314dd2af302db31532d.camel%40gammascience.co.uk
> <https://groups.google.com/d/msgid/django-developers/0874de593ac3d4cdd79a8314dd2af302db31532d.camel%40gammascience.co.uk?utm_medium=email&utm_source=footer>
> .
>


-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2%3DZEaxdd%2BB%3Dkc8B-JHeQ7%3DKZAUgb9DF0Cg99rVPo6oJQ%40mail.gmail.com.

Reply via email to