Re: Overriding ID Field

2009-02-20 Thread burcu hamamcıoğlu
I solved it , thanks :)

20 Şubat 2009 Cuma 14:08 tarihinde Veeravendhan sakkarai <
veeravend...@gmail.com> yazdı:

>
> You just define your primary key field in the models, you can over come.
> Also we can auto generate UUID. like the autoincrimint id field.
>
>
>
> On Fri, Feb 20, 2009 at 3:41 PM, burcu hamamcıoğlu 
> wrote:
> > I want to define a custom id field, that holds a guid (uuid). But how can
> i
> > override the default id field? I want it to modified as guid..
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~--~~~~--~~--~--~---



Re: Overriding ID Field

2009-02-20 Thread Veeravendhan sakkarai

You just define your primary key field in the models, you can over come.
Also we can auto generate UUID. like the autoincrimint id field.



On Fri, Feb 20, 2009 at 3:41 PM, burcu hamamcıoğlu  wrote:
> I want to define a custom id field, that holds a guid (uuid). But how can i
> override the default id field? I want it to modified as guid..
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~--~~~~--~~--~--~---



Re: Overriding ID Field

2009-02-20 Thread burcu hamamcıoğlu
I defined this field in my model like this.

 id = models.SlugField(max_length = 36, default = (lambda:
str(uuid.uuid4())), db_index = True,primary_key=True,unique = True)
But when i try to add a object from admin interface, I got an error message
like "Please correct the errors below. "
But there is not any error flaged field and i can't add an object.



2009/2/20 Masklinn 

>
> On 20 févr. 09, at 11:11, burcu hamamcıoğlu 
> wrote:
> > I want to define a custom id field, that holds a guid (uuid). But
> > how can i override the default id field? I want it to modified as
> > guid..
> >
> As indicated in the documentation, the 'id' field is only
> aurogenerated when a model has no defined primary key. If you want a
> GUID PK, simply create a guid field declared as pk in your model, you
> can name it 'id' if you wish to.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~--~~~~--~~--~--~---



Re: Overriding ID Field

2009-02-20 Thread Masklinn

On 20 févr. 09, at 11:11, burcu hamamcıoğlu   
wrote:
> I want to define a custom id field, that holds a guid (uuid). But  
> how can i override the default id field? I want it to modified as  
> guid..
>
As indicated in the documentation, the 'id' field is only  
aurogenerated when a model has no defined primary key. If you want a  
GUID PK, simply create a guid field declared as pk in your model, you  
can name it 'id' if you wish to. 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~--~~~~--~~--~--~---



Overriding ID Field

2009-02-20 Thread burcu hamamcıoğlu
I want to define a custom id field, that holds a guid (uuid). But how can i
override the default id field? I want it to modified as guid..

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~--~~~~--~~--~--~---