I\'ve followed django tutorial and arrived at tutorial05.
I tried to not show empty poll as tutorial says, so I added filter condition like this:
cla
Because you created two objects with same properties. If you want to ensure uniqueness, you should add validation in clean
and add unique index on identifier field too.
Besides filter
returns all the objects that match the criteria, if you are expecting only one item to be returned, you should use get
instead. get
would raise exception if less or more than 1 item is found.