Sometimes table have more than one foreign key reference to other tables.
Then how to descript it in model?
For eg:
Table A:
create table A (
oid varchar(10) not null,
pid varchar(10) not null,
color varchar(20)
oking for a many-to-many relationship using an
> intermediary table:
>
>
> https://docs.djangoproject.com/en/1.8/topics/db/models/#intermediary-manytomany
>
> -James
> On Aug 6, 2015 3:06 AM, "Holland_zwz" >
> wrote:
>
>> Sometimes table have more tha
Hi all,
I want to add one auto-increase PK which start from one given value(such
as start from 1000).
I try to write the model as following:
class MyModel(models.Model):
mid = models.AutoField(verbose_name='My
ID',primary_key=True,default='1000')
But only one record can be add when i add
Hi all,
I have 2 tables, one is A another is B, and B have one FK which contains
more than 1 field references to A. The table struct is here:
create table A
(
oid int not null,
types varchar(20) not null,
name varchar(30) null,
color varchar(20) null,
constraint PK_A primary key (oi
4 matches
Mail list logo