Hi Daniele,
thanks a lot for your explanation.
On Thu, 2015-06-25 at 15:02 +0100, Daniele Varrazzo wrote:
> On Thu, Jun 25, 2015 at 12:08 PM, Tilman Koschnick <til@subnetz.org> wrote:
> > is there a way to adapt extras.DateRange to use extensions.MXDATE as a
> > typecaster and accept/return mx.Date values directly?
> The Range casters use whatever typecaster is registered for its base
> type so, if you register the mx.Date typecaster the range one should
> just work. Testing it seems working:
> with the noticeable exception that there is no type mx.Date it seems,
> only DateTime (sorry but I can't remember much about mx objects: I
> haven't used them for a long time):
> So it seems it should mostly work out of the box. I don't know if the
> Date/DateTime confusion can be solved but it shouldn't be hard to copy
> the adapter (from the _range.py module) and kick it until it complies
> to adapt mx.DateTime objects as they were dates.
Apparently casting from plain dates as well as dateranges to mx.DateTime
works fine, as does casting mx.DateTime back to plain dates. I'll dig a
bit deeper in the _range.py module, as you suggest.
Regards, Til