Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new_slug = slug_name
- i = Url.objects.filter(content_type=content_type,
- action=action, path=create_url(new_slug, instance)).exclude(object_id=instance.pk).count()
- if i:
- new_slug = '%s_%d' % (slug_name, i)
Advertisement
Add Comment
Please, Sign In to add comment