Hi there!

Just getting into django and so far I'm really impressed (although I
second the sentiment for creating a unit testing framework).

My question is this:

When I want to compare two model objects is it safe to do something
like this:

user = users.get_list(id__exact = 3)[0]

if user == myuser:
    # do stuff

or should I do this:

if user.id == myuser.id:
    # do stuff

Which is correct (sometimes I find the former fails and I have to do an
id check)

Thx,
Zeb

Reply via email to