Sorry, I reply to this mail two times. On Jul 14, 7:47 pm, Alexandre González <a...@mirblu.com> wrote: > Are you talking about > this:http://www.djangoproject.com/documentation/models/custom_pk/?? > > You must declar jono as: > > jono = models.PositiveIntergerField(primary_key=True) > > On Wed, Jul 14, 2010 at 19:38, Jagdeep Singh Malhi > <singh.malh...@gmail.com>wrote: > > > > > > > I try this code to create database in using django. > > > file :models.py > > class amount(models.Model): > > jono = models.PositiveIntegerField(unique=True) > > name = models.CharField(max_length=750) > > receipt = models.CharField(max_length=200) > > phno = models.CharField(max_length=25) > > type = models.CharField(max_length=50) > > rdate = models.DateField('date published') > > site = models.CharField(max_length=200) > > > after run > > #python manage.py sql tcc > > command i get > > BEGIN; > > CREATE TABLE `tcc_amount` ( > > `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, > > `jono` integer UNSIGNED NOT NULL UNIQUE, > > `name` varchar(750) NOT NULL, > > `receipt` varchar(200) NOT NULL, > > `phno` varchar(25) NOT NULL, > > `type` varchar(50) NOT NULL, > > `rdate` date NOT NULL, > > `site` varchar(200) NOT NULL > > ) > > ; > > COMMIT; > > > But i want 'jono' is also AUTO_INCREMENT with 'id' or only jono > > not include the 'id '. > > Which code is used to make 'jono ' to auto increment.?? > > Pleases help ,if possible. > > > 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...@google > > groups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/django-users?hl=en. > > -- > Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt > and/or .pptxhttp://mirblu.com
-- 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.