Re: Doesn't save data django Foreignkey model

2019-08-26 Thread Mark Ochieng
Are trying to save data for Customer that does not exist in your CustomerData table yet. Because I think the error is tries to inform you that Billing data can only be created for a customer that already exists on you CustomerData On Sunday, August 25, 2019 at 5:17:24 PM UTC+3, Asaduzzaman

Doesn't save data django Foreignkey model

2019-08-25 Thread Asaduzzaman Sohel
I've two model. I would like to save data from ForeignKey model. I'm created a modelform and save with my main foreignkey model. But I got this error ValueError at /c/customer/1/ Cannot assign "'1'": "BillingData.customer" must be a "CustomerData" instance. I created Django model form and

Re: Django ForeignKey field name “check” raises SystemCheckError

2019-02-20 Thread Tim Graham
I believe the warning is incorrect. See https://code.djangoproject.com/ticket/23615 for the disucssion. On Wednesday, February 20, 2019 at 12:25:46 PM UTC-5, Eric Palmitesta wrote: > > The Django docs ( > https://docs.djangoproject.com/en/1.11/topics/db/models/#field-name-restrictions) > >

Django ForeignKey field name “check” raises SystemCheckError

2019-02-20 Thread Eric Palmitesta
The Django docs (https://docs.djangoproject.com/en/1.11/topics/db/models/#field-name-restrictions) state there are only two restrictions on model field names: 1. A field name cannot be a Python reserved word 2. A field name cannot contain more than one underscore in a row However,

Re: Django ForeignKey versus ManyToManyField

2013-02-07 Thread Huu Da Tran
On Wednesday, February 6, 2013 1:39:30 AM UTC-5, vijay shanker wrote: > I have two models, a Customer model and a WishListItem model (which stores > products). I have option of either having a ManyToManyField in Customer to > WishListItem, or I can have a customer ForeignKey to customer for

Re: Django ForeignKey versus ManyToManyField

2013-02-06 Thread Adam Mesha
On Wed, Feb 6, 2013 at 8:48 AM, Daniel Roseman wrote: > On Tuesday, 5 February 2013 22:39:30 UTC-8, vijay shanker wrote: > >> Hi >> I have two models, a Customer model and a WishListItem model (which >> stores products). I have option of either having a ManyToManyField in

Re: Django ForeignKey versus ManyToManyField

2013-02-05 Thread Daniel Roseman
On Tuesday, 5 February 2013 22:39:30 UTC-8, vijay shanker wrote: > Hi > I have two models, a Customer model and a WishListItem model (which stores > products). I have option of either having a ManyToManyField in Customer to > WishListItem, or I can have a customer ForeignKey to customer for

Django ForeignKey versus ManyToManyField

2013-02-05 Thread vijay shanker
Hi I have two models, a Customer model and a WishListItem model (which stores products). I have option of either having a ManyToManyField in Customer to WishListItem, or I can have a customer ForeignKey to customer for each WishListItem. Which one will be more efficient ? Thanks -- You

Django ForeignKey which does not require referential integrity?

2012-06-04 Thread diabeteman
For the record, I've looked deep into django's code to find what needs to be done, but I think that simply subclassing ForeignKey will not be enough. NB: I use South for managing my database schema, so I figure I'll need to do something about that too. But it may be out of the subject here :)

Django ForeignKey which does not require referential integrity?

2012-06-04 Thread diabeteman
Bump ;-) I know my question is a bit technical but could someone help ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/WuyUm2Xs5jYJ. To post to this

Django ForeignKey which does not require referential integrity?

2012-05-27 Thread diabeteman
is a related question http://stackoverflow.com/questions/3558907/django-foreignkey-which-does-not-require-referential-integrity Could you give me some orientation on how to create a custom ForeignKey field that does not create database constraints with syncdb and south migrations? Thanks in advance

Re: Django ForeignKey to_field vs. db_column

2009-09-14 Thread Daniel Roseman
On Sep 14, 7:19 pm, Artur Ergashev wrote: > I'm working on some models for a legacy database structure, and am > having a road_block with Foreign Keys and non-conventional names. > > As I understand it, if in my model I have something like: > > something = ForeignKey(something)

Django ForeignKey to_field vs. db_column

2009-09-14 Thread Artur Ergashev
I'm working on some models for a legacy database structure, and am having a road_block with Foreign Keys and non-conventional names. As I understand it, if in my model I have something like: something = ForeignKey(something) then django will look for the something_id field in my table when

Re: django foreignkey

2007-07-19 Thread james_027
hi, it seems that there is a small bug for not creating the foreign key on the database. Please see this ticket. http://code.djangoproject.com/ticket/4930#preview Thanks james On Jul 20, 9:05 am, james_027 <[EMAIL PROTECTED]> wrote: > anyone to help me on this? > > thanks > james > > On Jul

Re: django foreignkey

2007-07-19 Thread james_027
anyone to help me on this? thanks james On Jul 19, 3:20 pm, james_027 <[EMAIL PROTECTED]> wrote: > Hi Nathan, > > I did manage.py syncdb with the table still not existing. I did > manage.py sqlall myapps when saw that the foreign key was not created. > > here is my actual source code. > > from

Re: django foreignkey

2007-07-19 Thread james_027
Hi Nathan, I did manage.py syncdb with the table still not existing. I did manage.py sqlall myapps when saw that the foreign key was not created. here is my actual source code. from django.db import models from django.contrib.auth.models import User as AdminUser # Create your models here.

Re: django foreignkey

2007-07-19 Thread Nathan Ostgard
manage.py syncdb won't add new fields to the database if the table already exists. You'll have to do this yourself. See manage.py sqlall for some help. Otherwise, if you have: user = models.ForeignKey(User), then look for a field named user_id in your table. Nathan Ostgard On Jul 18,

django foreignkey

2007-07-18 Thread james_027
hi, I have a model with a field models.ForeignKey(), with manage.py validate I check if my code are right, then run manage.py syncdb. When I was checking the tables generated I don't see any foreign key created? Is there something wrong? where should I check? I am using django 0.96, mysql 5 on