Re: Pendolumn

2020-09-10 Thread Adam Johnson
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 
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 
> 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_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.


Re: Pendolumn

2020-09-10 Thread Roger Gammans
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 
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.


Re: Pendolumn

2020-09-09 Thread Curtis Maloney
Hi, Damiano

I suspect we chatted on IRC yesterday about this...

On Wed, 9 Sep 2020, at 11:01, Damiano Porta wrote:
> Hello everybody!
> Can I use Pendolumn (https://pendulum.eustace.io/) as default datetime 
> library for my models?
> This library is good, it has very intuitive and clean API design. It is 
> relying on the standard library. So, it is basically a "more advanced" 
> datetime.

You can use whatever tools you want in your application.

Where do you see this library in particular providing benefit in your models?

What I understood of your query yesterday [if it were, indeed, you] was you 
were proposing Django used this lib throughout.

If that is the case, you would need to clearly describe what benefits the 
project as a whole would gain by bringing on this dependency that couldn't 
already be managed by a 3rd party package that individual projects could opt to 
use.

--
Curtis

-- 
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/30434283-7856-47a9-9720-a3204f084af4%40www.fastmail.com.


Pendolumn

2020-09-09 Thread Damiano Porta
Hello everybody!
Can I use Pendolumn (https://pendulum.eustace.io/) as default datetime 
library for my models?
This library is good, it has very intuitive and clean API design. It is 
relying on the standard library. So, it is basically a "more advanced" 
datetime.
Thanks

-- 
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/4150ad6f-09b4-4166-b2ed-78c23de7e8e0n%40googlegroups.com.