Posted By

magicrebirth on 10/03/11


Tagged

django models


Versions (?)

Django: check whether an object already exists before adding


 / Published in: Django
 

URL: http://stackoverflow.com/questions/1821176/django-check-whether-an-object-already-exists-before-adding

  1. role, created = UserToUserRole.objects.get_or_create(
  2. from_user=current_user, to_user=user, role='follow')

Report this snippet  

You need to login to post a comment.