Re: Unique Field

2020-01-21 Thread Soumen Khatua
Okay Thanks for the information. On Wed, 22 Jan 2020, 02:11 Irfan Khan, wrote: > No I didn’t check that one, it will generate unique id’s for you but how > many you wanted to generate you must write code explicitly with some logic > > On Wed, 22 Jan 2020 at 1:43 AM, Soumen Khatua > wrote: > >>

Re: Unique Field

2020-01-21 Thread Irfan Khan
No I didn’t check that one, it will generate unique id’s for you but how many you wanted to generate you must write code explicitly with some logic On Wed, 22 Jan 2020 at 1:43 AM, Soumen Khatua wrote: > Irfan- Are you sure it will generate unique id for 10 billion people. > > On Wed, 22 Jan 2020

Re: Unique Field

2020-01-21 Thread Soumen Khatua
Irfan- Are you sure it will generate unique id for 10 billion people. On Wed, 22 Jan 2020, 01:39 Irfan Khan, wrote: > Here you can check this link for reference > > https://pypi.org/project/nanoid/ > > > On Tue, 21 Jan 2020 at 9:02 PM, Soumen Khatua > wrote: > >> Could you share any documentati

Re: Unique Field

2020-01-21 Thread Irfan Khan
Here you can check this link for reference https://pypi.org/project/nanoid/ On Tue, 21 Jan 2020 at 9:02 PM, Soumen Khatua wrote: > Could you share any documentation link,please?? > > On Tue, 21 Jan 2020, 20:45 Irfan Khan, wrote: > >> You can use nano library to generate unique numbers or char

Re: Unique Field

2020-01-21 Thread Soumen Khatua
Could you share any documentation link,please?? On Tue, 21 Jan 2020, 20:45 Irfan Khan, wrote: > You can use nano library to generate unique numbers or characters > > On Tue, 21 Jan 2020 at 8:41 PM, Soumen Khatua > wrote: > >> Hi Folks, >> >> Is their any other library or module is available exc

Re: Unique Field

2020-01-21 Thread Irfan Khan
You can use nano library to generate unique numbers or characters On Tue, 21 Jan 2020 at 8:41 PM, Soumen Khatua wrote: > Hi Folks, > > Is their any other library or module is available except UUID which can > generate unique number in python? > > As I mentioned earlier I want to use random uniqu

Unique Field

2020-01-21 Thread Soumen Khatua
Hi Folks, Is their any other library or module is available except UUID which can generate unique number in python? As I mentioned earlier I want to use random unique number in django for billion user. Just like account number,please tell me any unique module. Thank You In advance Thank You Re

Re: AttributeError for unique field during ModelForm validation

2012-11-11 Thread Rohit Banga
>>> Hi! >>> I would try to set unique property within "real" model, not within >>> abstract base class. Besides django creates unique pk on each model by >>> default, so to my mind creating additional unique field is redundant. Not >>> quite sure,

Re: AttributeError for unique field during ModelForm validation

2012-11-11 Thread Andrejus
would try to set unique property within "real" model, not within >> abstract base class. Besides django creates unique pk on each model by >> default, so to my mind creating additional unique field is redundant. Not >> quite sure, but there seems to be some rest

Re: AttributeError for unique field during ModelForm validation

2012-11-10 Thread Rohit Banga
5:12:18 PM UTC-5, Andrejus wrote: > > Hi! > I would try to set unique property within "real" model, not within > abstract base class. Besides django creates unique pk on each model by > default, so to my mind creating additional unique field is redundant. Not > quite

Re: AttributeError for unique field during ModelForm validation

2012-11-10 Thread Andrejus
Hi! I would try to set unique property within "real" model, not within abstract base class. Besides django creates unique pk on each model by default, so to my mind creating additional unique field is redundant. Not quite sure, but there seems to be some restrictions on use of uniqu

AttributeError for unique field during ModelForm validation

2012-11-10 Thread Rohit Banga
I noticed a strange behavior with Django and filed a bug https://code.djangoproject.com/ticket/19271#ticket It is suggested that I first check on the support group if the bug is valid or not. Fair Enough. I have created a standalone project to demonstrate the problem. In order to run it you may

Re: 'unique' field upon inserting

2011-01-25 Thread Patrick McDonnell
On Tue, Jan 25, 2011 at 10:28 AM, Jonas Geiregat wrote: > The id field (which is added by django by default has this) other then that > the field doesn't have unique=True > > I was also thinking of a better solution. > > I have a Gig model which contains gigs with a ForeignKey to Artist. > I have

Re: 'unique' field upon inserting

2011-01-25 Thread Jonas Geiregat
The id field (which is added by django by default has this) other then that the field doesn't have unique=True I was also thinking of a better solution. I have a Gig model which contains gigs with a ForeignKey to Artist. I have a Artist model which contains artists. One Gig can have multiple ar

Re: 'unique' field upon inserting

2011-01-25 Thread kmpm
I don't know if this will make you happy but when I researched this some months ago I found no good solution. During my search I came upon the following pages that sort of relate to this... - http://github.com/dcramer/django-idmapper - http://appengine-cookbook.appspot.com/recipe/hi

Re: 'unique' field upon inserting

2011-01-25 Thread Shawn Milochik
Do you have 'unique = True' in the field definition in the model? -- 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+uns

'unique' field upon inserting

2011-01-25 Thread Jonas Geiregat
Hello, I have a model that has a field of the type BigIntegerField(). When inserting something into that field the value must not have been used before but upon inserting it's possible to insert the same value twice. Is there a way to do this using django ? I could generate a random number ch

Problem with editing unique field

2011-01-13 Thread galago
form.save_m2m() The problem is, when I don't change the title - i get error that title field is already in database:/ Can I do something that let me save my edited object with that unique field not changed? -- You received this message because you are subscribed to the Google Groups &q

Re: Unique Field Combinations

2009-04-04 Thread Chris Spencer
Thanks. On Sat, Apr 4, 2009 at 11:26 AM, Daniel Roseman wrote: > > On Apr 4, 2:06 pm, Chris wrote: >> How would you enforce a unique column constraint on a combination of >> fields? >> >> For example, say I have the model: >> >> class Company(models.Model): >> name = models.CharField(unique

Re: Unique Field Combinations

2009-04-04 Thread Daniel Roseman
On Apr 4, 2:06 pm, Chris wrote: > How would you enforce a unique column constraint on a combination of > fields? > > For example, say I have the model: > > class Company(models.Model): >     name = models.CharField(unique=True) > > class Article(models.Model): >     company = models.ForeignKey(Co

Unique Field Combinations

2009-04-04 Thread Chris
How would you enforce a unique column constraint on a combination of fields? For example, say I have the model: class Company(models.Model): name = models.CharField(unique=True) class Article(models.Model): company = models.ForeignKey(Company) title = models.CharField(max_length=500

Re: newforms unique field(s)

2007-06-04 Thread [EMAIL PROTECTED]
I finally pulled this together and submitted it as a ticket: http://code.djangoproject.com/ticket/4473 -joe On May 22, 9:47 am, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > I thought the same thing. :-) I'll take a whack at wringing it > together and submitting it as a patch, and you can be appall

Re: newforms unique field(s)

2007-05-22 Thread Joseph Heck
I thought the same thing. :-) I'll take a whack at wringing it together and submitting it as a patch, and you can be appalled at my slaughtering of your fine explanation. -joe On 5/21/07, simonbun <[EMAIL PROTECTED]> wrote: > > Great stuff again Malcolm. Perhaps it should be rehashed a bit and p

Re: newforms unique field(s)

2007-05-21 Thread simonbun
Great stuff again Malcolm. Perhaps it should be rehashed a bit and put in the newforms docs under 'custom validation' ? Just a thought :) regards, Simon On May 22, 12:11 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2007-05-21 at 14:00 -0500, Tim Chase wrote: > > > What is the "ge

Re: newforms unique field(s)

2007-05-21 Thread Malcolm Tredinnick
On Mon, 2007-05-21 at 14:00 -0500, Tim Chase wrote: > > What is the "general way" to add your own validation to forms under > > the newforms framework? > > > > Subclassing and adding in your clean_* methods? Using decorators or > > the such around existing validation? Adding your own custom Field

Re: newforms unique field(s)

2007-05-21 Thread Malcolm Tredinnick
[Apologies if this appears twice. I think Google ate my homework the first time.] On Mon, 2007-05-21 at 14:00 -0500, Tim Chase wrote: > > What is the "general way" to add your own validation to forms under > > the newforms framework? > > > > Subclassing and adding in your clean_* methods? Using

Re: newforms unique field(s)

2007-05-21 Thread Malcolm Tredinnick
On Tue, 2007-05-22 at 08:11 +1000, Malcolm Tredinnick wrote: > On Mon, 2007-05-21 at 14:00 -0500, Tim Chase wrote: > > > What is the "general way" to add your own validation to forms under > > > the newforms framework? > > > > > > Subclassing and adding in your clean_* methods? Using decorators o

Re: newforms unique field(s)

2007-05-21 Thread Matt
After looking at http://code.google.com/p/django-registration/: forms.py [...] def clean_username(self): """ Validates that the username is not already in use. """ if self.cleaned_data.get('username', None): try: user = User.objects

Re: newforms unique field(s)

2007-05-21 Thread Tim Chase
> What is the "general way" to add your own validation to forms under > the newforms framework? > > Subclassing and adding in your clean_* methods? Using decorators or > the such around existing validation? Adding your own custom Field > objects and setting their "clean" methods? My understandin

Re: newforms unique field(s)

2007-05-21 Thread Joseph Heck
What is the "general way" to add your own validation to forms under the newforms framework? Subclassing and adding in your clean_* methods? Using decorators or the such around existing validation? Adding your own custom Field objects and setting their "clean" methods? -joe On 5/21/07, Matt <[EM

newforms unique field(s)

2007-05-21 Thread Matt
I have a form that allows users to submit their name and email address for an invitation. I do not want people signing up more than once. The following code works, but it does not seem like the "Best Practice" solution. forms.py [...imports...] class RequestInvite(forms.Form): name = form

Re: django admin : "unique" field option error with models.BooleanField

2006-11-13 Thread david83
code = models.PositiveIntegerField("Code", unique=True) For example : with a PositiveIntegerField, I can't insert 2 entries with code = 100. Django display error message. With a BooleanField, I can insert 2 or many entries with boolean = 1 without error message. The unique option doesn't apply h

Re: django admin : "unique" field option error with models.BooleanField

2006-11-12 Thread Nathan R. Yergler
By definition there are only two possible values for a BooleanField: True and False. And if you add the unique=True constraint (which says each row must be unique), well, two is all you get. Maybe unique=True isn't exactly what you want? Nathan On Sun, 2006-11-12 at 02:41 -0800, david83 wrote:

django admin : "unique" field option error with models.BooleanField

2006-11-12 Thread david83
Hi, I have created my model with : uniquechoice = models.BooleanField("uniquechoice", unique=True) In django admin interface, I can insert 2 items with uniquechoice checked without dango admin send me error message. How to solve this? --~--~-~--~~~---~--~~ Yo