On 19/07/2013 11:31am, Victor Hooi wrote:
Hi,

I'm just wondering - is it considered good or bad practice to use a
Django model's in-built ID field?

Say for example you wanted a unique identifier for each transactio -
should you be generating your own, or can you use just self.id?

Don't go there. Generate your own. Consider what might happen if you needed to migrate to a different database or platform. The id integer will be a nightmare to manage so the unique transactions retain their original numbers.

Mike



Cheers,
Victor

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to