Hi,

Ok, thanks, I'll generate my own AutoField to track each transaction.

Just to clarify - when you say they'll be issues with migration, what do 
you mean? Is it because that field is also as a FK to other models? Or 
something else?

Cheers,
Victor

On Friday, 19 July 2013 11:50:25 UTC+10, Mike Dewhirst wrote:
>
> 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...@googlegroups.com <javascript:>. 
> > To post to this group, send email to 
> > django...@googlegroups.com<javascript:>. 
>
> > 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