Re: [Django] #25813: models.py by 'inspectdb' command gives me error

2015-11-25 Thread Django
#25813: models.py by 'inspectdb' command gives me error
-+-
 Reporter:  GarlicDipping|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.8
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  inspectdb, MySQL | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by GarlicDipping):

 Replying to [comment:2 timgraham]:
 > Might be a duplicate of #25274 -- could you test the patch there?

 Thanks, Now it works good. If it's duplicate, should I remove this ticket?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.565beb3e759dc9e26b2e06e39a55fd00%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25813: models.py by 'inspectdb' command gives me error

2015-11-25 Thread Django
#25813: models.py by 'inspectdb' command gives me error
-+-
 Reporter:  GarlicDipping|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.8
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  inspectdb, MySQL | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * keywords:  indpectdb, MySQL => inspectdb, MySQL


Comment:

 Might be a duplicate of #25274 -- could you test the patch there?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.f564a49c25aa7288ea76824bd3ed5139%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25813: models.py by 'inspectdb' command gives me error

2015-11-25 Thread Django
#25813: models.py by 'inspectdb' command gives me error
-+-
 Reporter:  GarlicDipping|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.8
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  indpectdb, MySQL | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by GarlicDipping):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Old description:

> Hi, I'm currently using Django with MySQL and having some trouble with
> models.py generated by inspectdb command.
>
> So, DDL First :
>

> {{{
> CREATE TABLE YDB_Collects (
> COriginal_Data_Type_ID VARCHAR(16) NOT NULL,
> CTask_Name VARCHAR(16) NOT NULL,
> PRIMARY KEY (COriginal_Data_Type_ID, CTask_Name),
> INDEX FK_COLLECTS_TASK (CTask_Name),
> CONSTRAINT FK_COLLECTS_ORIGINAL_DATA_TYPE FOREIGN KEY
> (COriginal_Data_Type_ID) REFERENCES YDB_Original_Data_Type
> (Original_Data_Type_ID),
> CONSTRAINT FK_COLLECTS_TASK FOREIGN KEY (CTask_Name) REFERENCES
> YDB_Task (Task_Name)
> )
> }}}
>

> And Django's 'inspectdb' command gave me this model :
>

> {{{
> class YdbCollects(models.Model):
> coriginal_data_type = models.ForeignKey('YdbOriginalDataType',
> db_column='COriginal_Data_Type_ID')  # Field name made lowercase.
> ctask_name = models.ForeignKey('YdbTask', db_column='CTask_Name')  #
> Field name made lowercase.
>
> class Meta:
> managed = False
> db_table = 'ydb_collects'
> unique_together = (('COriginal_Data_Type_ID', 'CTask_Name'),)
>
> }}}
>
> And when I run 'makemigrations' command, It gives me error message :
> 'unique-together refers to the non-existent field
> 'COriginal_Data_Type_ID' and 'CTask_Name'.
>
> When I change
>

> {{{
>  unique_together = (('COriginal_Data_Type_ID', 'CTask_Name'),)
> }}}
>
> Into
>

> {{{
> unique_together = (('coriginal_data_type ', 'ctask_name'),)
> }}}
>
> then It goes OK but is this correct way to go?
>
> Seems like code below has different schema from my DDL...Original foreign
> key I defined was id of data type, not data type itself.
>
> Did I do something wrong here? Why does unique_together() has column
> names? Every Django models generated with MySQL's ''PRIMARY_KEY(Key1,
> Key2, ...)'' gives me this error!

New description:

 Hi, I'm currently using Django with MySQL and having some trouble with
 models.py generated by inspectdb command.

 So, DDL First :


 {{{
 CREATE TABLE YDB_Collects (
 COriginal_Data_Type_ID VARCHAR(16) NOT NULL,
 CTask_Name VARCHAR(16) NOT NULL,
 PRIMARY KEY (COriginal_Data_Type_ID, CTask_Name),
 INDEX FK_COLLECTS_TASK (CTask_Name),
 CONSTRAINT FK_COLLECTS_ORIGINAL_DATA_TYPE FOREIGN KEY
 (COriginal_Data_Type_ID) REFERENCES YDB_Original_Data_Type
 (Original_Data_Type_ID),
 CONSTRAINT FK_COLLECTS_TASK FOREIGN KEY (CTask_Name) REFERENCES
 YDB_Task (Task_Name)
 )
 }}}


 And Django's 'inspectdb' command gave me this model :


 {{{
 class YdbCollects(models.Model):
 coriginal_data_type = models.ForeignKey('YdbOriginalDataType',
 db_column='COriginal_Data_Type_ID')  # Field name made lowercase.
 ctask_name = models.ForeignKey('YdbTask', db_column='CTask_Name')  #
 Field name made lowercase.

 class Meta:
 managed = False
 db_table = 'ydb_collects'
 unique_together = (('COriginal_Data_Type_ID', 'CTask_Name'),)

 }}}

 And when I run 'makemigrations' command, It gives me error message :
 'unique-together refers to the non-existent field 'COriginal_Data_Type_ID'
 and 'CTask_Name'.

 When I change


 {{{
  unique_together = (('COriginal_Data_Type_ID', 'CTask_Name'),)
 }}}

 Into


 {{{
 unique_together = (('coriginal_data_type ', 'ctask_name'),)
 }}}

 then It goes OK but is this correct way to go?

 Seems like code below has different schema from my DDL...Original foreign
 key I defined was id of data type, not data type itself.

 Did I do something wrong here? Why does unique_together() has column name,
 not field names? Every Django models generated with MySQL's
 ''PRIMARY_KEY(Key1, Key2, ...)'' gives me this error!

--

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 

[Django] #25813: models.py by 'inspectdb' command gives me error

2015-11-25 Thread Django
#25813: models.py by 'inspectdb' command gives me error
--+
 Reporter:  GarlicDipping |  Owner:  nobody
 Type:  Bug   | Status:  new
Component:  Database layer (models, ORM)  |Version:  1.8
 Severity:  Normal|   Keywords:  indpectdb,
  |  MySQL
 Triage Stage:  Unreviewed|  Has patch:  0
Easy pickings:  0 |  UI/UX:  0
--+
 Hi, I'm currently using Django with MySQL and having some trouble with
 models.py generated by inspectdb command.

 So, DDL First :


 {{{
 CREATE TABLE YDB_Collects (
 COriginal_Data_Type_ID VARCHAR(16) NOT NULL,
 CTask_Name VARCHAR(16) NOT NULL,
 PRIMARY KEY (COriginal_Data_Type_ID, CTask_Name),
 INDEX FK_COLLECTS_TASK (CTask_Name),
 CONSTRAINT FK_COLLECTS_ORIGINAL_DATA_TYPE FOREIGN KEY
 (COriginal_Data_Type_ID) REFERENCES YDB_Original_Data_Type
 (Original_Data_Type_ID),
 CONSTRAINT FK_COLLECTS_TASK FOREIGN KEY (CTask_Name) REFERENCES
 YDB_Task (Task_Name)
 )
 }}}


 And Django's 'inspectdb' command gave me this model :


 {{{
 class YdbCollects(models.Model):
 coriginal_data_type = models.ForeignKey('YdbOriginalDataType',
 db_column='COriginal_Data_Type_ID')  # Field name made lowercase.
 ctask_name = models.ForeignKey('YdbTask', db_column='CTask_Name')  #
 Field name made lowercase.

 class Meta:
 managed = False
 db_table = 'ydb_collects'
 unique_together = (('COriginal_Data_Type_ID', 'CTask_Name'),)

 }}}

 And when I run 'makemigrations' command, It gives me error message :
 'unique-together refers to the non-existent field 'COriginal_Data_Type_ID'
 and 'CTask_Name'.

 When I change


 {{{
  unique_together = (('COriginal_Data_Type_ID', 'CTask_Name'),)
 }}}

 Into


 {{{
 unique_together = (('coriginal_data_type ', 'ctask_name'),)
 }}}

 then It goes OK but is this correct way to go?

 Seems like code below has different schema from my DDL...Original foreign
 key I defined was id of data type, not data type itself.

 Did I do something wrong here? Why does unique_together() has column
 names? Every Django models generated with MySQL's ''PRIMARY_KEY(Key1,
 Key2, ...)'' gives me this error!

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/056.2ea0fb11ac9df99771b8140bf7dcb664%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.