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 would be undesirable, a
> more modest option would be a simple "is_saved()" method.
>
> Does either of these options sound reasonable? If so, I'm happy to
> make up a patch, including changes to db-api.txt.

Hey Alan,

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 primary-key value is set. But, if I
understand correctly, that would be overkill for your situation,
right?

By the way, you're right not to use _get_pk_val(). Although I don't
suspect that will change, there's no guarantee -- it should be
considered off-limits (i.e., there's a reason it's undocumented).

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to