Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-06 Thread [EMAIL PROTECTED]
I made this suggestion on the django board. @auto_now('updatted_on') @auto_add_now('submitted_date') def save(self): super(MyModel).save() I even have started coding it as I need SOME solution that is simple. One problem I have had is with edit_inline and auto_now where the entries are

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-06 Thread Joseph Perla
+1. Follows DRY. An AutoDateTimeField is very common. j On 4/6/07, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > > > > seems like it should be as easy as a function in contrib somewhere: > [snip] > > Another option is a trivial field subclass:: > > class

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-06 Thread Jacob Kaplan-Moss
> seems like it should be as easy as a function in contrib somewhere: [snip] Another option is a trivial field subclass:: class AutoDateTimeField(models.DateTimeField): def pre_save(self, model_instance, add): return datetime.datetime.now() Jacob

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-06 Thread Sean Perry
On Apr 6, 2007, at 11:39 AM, David Larlet wrote: > > 2007/4/6, Brian Beck <[EMAIL PROTECTED]>: >> >> On Apr 2, 12:52 pm, "trbs" <[EMAIL PROTECTED]> wrote: >>> It could be just me, but although i don't mind losing auto_*, it >>> don't >>> look very DRY in save. >>> >>> I know it's only a few

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-06 Thread Brian Beck
Did people feel that save() was a better solution because it's already a place where you have to put equivalent functionality for other fields? I don't know why, but defining my own save() always seems like a "big deal" that should be reserved for more complex stuff. What about a new attribute

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-06 Thread David Larlet
2007/4/6, Brian Beck <[EMAIL PROTECTED]>: > > On Apr 2, 12:52 pm, "trbs" <[EMAIL PROTECTED]> wrote: > > It could be just me, but although i don't mind losing auto_*, it don't > > look very DRY in save. > > > > I know it's only a few lines (like 4 ? for both options, not using > > default= for

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-06 Thread Brian Beck
On Apr 2, 12:52 pm, "trbs" <[EMAIL PROTECTED]> wrote: > It could be just me, but although i don't mind losing auto_*, it don't > look very DRY in save. > > I know it's only a few lines (like 4 ? for both options, not using > default= for sake of keeping the logic together) but when lots of >

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-02 Thread trbs
On Apr 2, 2:50 am, "Adrian Holovaty" <[EMAIL PROTECTED]> wrote: > On 4/1/07, SmileyChris <[EMAIL PROTECTED]> wrote: > > > I'm not sure if there's a ticket for this, but I remember talk about > > it being an unnecessary wart which was going to be removed eventually. > > Is it in the 1.0 plan? > >

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-01 Thread Honza Král
On 4/2/07, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 4/1/07, SmileyChris <[EMAIL PROTECTED]> wrote: > > I'm not sure if there's a ticket for this, but I remember talk about > > it being an unnecessary wart which was going to be removed eventually. > > Is it in the 1.0 plan? > > Yes, I'd

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-01 Thread Malcolm Tredinnick
On Mon, 2007-04-02 at 09:21 +0800, Russell Keith-Magee wrote: > On 4/2/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > > Is there an easy way to say "today - 3 days" just using the datetime > > module? I can't think of one off the top of my head that isn't as > > complex as LazyDate(),

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-01 Thread Malcolm Tredinnick
On Mon, 2007-04-02 at 11:11 +1000, Malcolm Tredinnick wrote: [...] > At the moment LazyDate is useful in limit_choices_to and as a default > value. Scrub that last part. Wishful thinking on my part. It can't really be used as a default at the moment, because it doesn't have a __call__ method.

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-01 Thread Russell Keith-Magee
On 4/2/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > Is there an easy way to say "today - 3 days" just using the datetime > module? I can't think of one off the top of my head that isn't as > complex as LazyDate(), but that may be because it's Monday. How about: lambda : datetime.now()

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-01 Thread Malcolm Tredinnick
On Mon, 2007-04-02 at 09:00 +0800, Russell Keith-Magee wrote: > On 4/2/07, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > > > On 4/1/07, SmileyChris <[EMAIL PROTECTED]> wrote: > > > I'm not sure if there's a ticket for this, but I remember talk about > > > it being an unnecessary wart which was

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-01 Thread Jacob Kaplan-Moss
On 4/1/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > What about LazyDate? It seems to me that given > "default=datetime.datetime.now" is legal, LazyDate can be deprecated > as well. Yeah, I'd like to get rid of LazyDate, too. Jacob --~--~-~--~~~---~--~~

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-01 Thread Russell Keith-Magee
On 4/2/07, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 4/1/07, SmileyChris <[EMAIL PROTECTED]> wrote: > > I'm not sure if there's a ticket for this, but I remember talk about > > it being an unnecessary wart which was going to be removed eventually. > > Is it in the 1.0 plan? > > Yes, I'd

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-01 Thread Jacob Kaplan-Moss
On 4/1/07, SmileyChris <[EMAIL PROTECTED]> wrote: > I'm not sure if there's a ticket for this, but I remember talk about > it being an unnecessary wart which was going to be removed eventually. > Is it in the 1.0 plan? Oh, please, yes! I'd be inclined just to remove 'em wholesale and let things

Re: Are we dropping auto_now and auto_now_add for 1.0?

2007-04-01 Thread Adrian Holovaty
On 4/1/07, SmileyChris <[EMAIL PROTECTED]> wrote: > I'm not sure if there's a ticket for this, but I remember talk about > it being an unnecessary wart which was going to be removed eventually. > Is it in the 1.0 plan? Yes, I'd like to drop those two options. auto_now can be accomplished with

Are we dropping auto_now and auto_now_add for 1.0?

2007-04-01 Thread SmileyChris
I'm not sure if there's a ticket for this, but I remember talk about it being an unnecessary wart which was going to be removed eventually. Is it in the 1.0 plan? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups