Re: [Pulp-list] [dev] create custom mongoengine field for datetime?

2015-11-23 Thread Michael Hrivnak
Well then, here is a PR for your collective review: https://github.com/pulp/pulp/pull/2188 Michael On Mon, Nov 23, 2015 at 12:55 PM, Sean Myers wrote: > On 11/23/2015 12:04 PM, Michael Hrivnak wrote: > > Following up on this: https://github.com/pulp/pulp/pull/2067/files

[Pulp-list] [dev] create custom mongoengine field for datetime?

2015-11-23 Thread Michael Hrivnak
Following up on this: https://github.com/pulp/pulp/pull/2067/files ... the problem seems to be that mongoengine's DateTimeField does not attach a timezone to the datetime objects it pulls out of the DB, but some (most? all?) parts of pulp expect to compare datetimes that DO have a timezone. I've

Re: [Pulp-list] [dev] create custom mongoengine field for datetime?

2015-11-23 Thread Sean Myers
On 11/23/2015 12:04 PM, Michael Hrivnak wrote: > Following up on this: https://github.com/pulp/pulp/pull/2067/files > > > > Thoughts? Perhaps those who have been heavily involved in the mongoengine > conversion already have considered this. this++, timezones-- I hate naive datetime objects, and

Re: [Pulp-list] [dev] create custom mongoengine field for datetime?

2015-11-23 Thread Brian Bouterse
In converting to mongoengine, we have not yet thought through this problem. I agree with your two approaches and assessment. Using the UTCDateTimeField is a good short term solution because it will be simple to implement. By doing the timezone conversion in to_python() we can avoid littering the