dizballanze

Untitled

Apr 24th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. new_slug = slug_name
  2. i = Url.objects.filter(content_type=content_type,
  3. action=action, path=create_url(new_slug, instance)).exclude(object_id=instance.pk).count()
  4. if i:
  5. new_slug = '%s_%d' % (slug_name, i)
Advertisement
Add Comment
Please, Sign In to add comment