How about a timestamp?

  import time
  name = str(time.time())

On Thu, Jan 14, 2010 at 2:45 PM, nameless <xsatelli...@gmail.com> wrote:

>
>
> I want username field is automatically filled with this value:
>
> username = str(n);
>
> where n is a number of 10 digits ( autoincremented or random ).
>
> .
>
> I tried to add this in save method:
>
> username = str(random.randint(1000000000,9999999999))
>
> but there is a collision problem when n is the same for 2 users
> ( although rare initially ).
>
> .
>
> How do I do this ?
>
> Thanks ^_^
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Reply via email to