wouldn't checking for the presence of an id enough? as far as I know instantiated objects don't have id's
On Tue, Jan 21, 2014 at 10:16 AM, Erik Cederstrand < [email protected]> wrote: > Den 21/01/2014 kl. 08.58 skrev Johannes Schneider < > [email protected]>: > > > maybe I I formulated it not precise enough. > > I need to check if some instance of a model comes from some database > query (e.g. via get(..)) or is instanciated 'by hand'. and not jet written > to the database. > > In this case I don't need to know, if there is an related object (e.g. > with the same pk or same values for its attributes) in the database. > > Okay. Sounds like your best bet is to either roll your own, or use the > undocumented API as suggested by Tom Evans. > > Either way, make sure to write tests so this doesn’t break when you > upgrade Django. > > Erik > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/78B3DC94-CBFC-4F38-A35C-73F54CAB572A%40cederstrand.dk > . > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFWa6t%2Brm9REWaWUTqZHd4Wv3Pw212RLGSh89%2BWJwC7NFNM%3DqQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.

