views:

29

answers:

1

In my application I've added "Facebook Comment Box" on different pages for different objects. Each object has it's own comments list so I need to provide a unique (across the site) xid for every single one of them. So what would be the best approach for achieving this ? Some abstract model that all other models will inherit ? Dummy model and then ForeignKey relation ? What are your ideas ?

+2  A: 

You may want to implement GUIDs:

http://www.codecommit.com/blog/database/are-guids-really-the-way-to-go

Here's a django module that gives you a field for 'em:

http://pypi.python.org/pypi/softwarefabrica.django.utils/

... you can safely use them in URLs -- won't be pretty, but for comments and other things without obvious URL-able titles, GUIDs work out well.

fish2000