Re: A model_object.is_saved() method

2006-08-13 Thread Alan Green
On 8/13/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > This is an interesting feature request/idea. If we were to add a > default method along the lines of is_saved(), I think it would make > the most sense if that method actually *checked* the database rather > than just checking that the prima

Re: A model_object.is_saved() method

2006-08-12 Thread Adrian Holovaty
On 8/12/06, Alan Green <[EMAIL PROTECTED]> wrote: > I would have used django.db.models.Model._get_pk_val() method, except > for the leading underscore marking the method as being for private > use. Hence the first option, at the top of this email. > > If exposing the primary key value like that wo

A model_object.is_saved() method

2006-08-12 Thread Alan Green
Hi Everyone, I'd like to propose a small change to django.db.models.Model to make it neater to determine whether or not a model object is already stored in the database. Either: Option 1: Rename the _get_pk_val() method to get_pk_val(), marking it safe for public use. Option 2: Add a method name