Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign uppwiz columns invalid names #1022
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Hmmm.... |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
coleifer
Jul 21, 2016
Owner
Can you explain this in a bit more detail? What exactly is the nature of this bug?
|
Can you explain this in a bit more detail? What exactly is the nature of this bug? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
vinczente
Jul 22, 2016
This is a example of generated code from pwiz
class Flag(BaseModel):
description = TextField(null=True)
flag id = CharField(null=True)
name = CharField(null=True)
python will syntax error:
flag id = CharField(null=True)
^
SyntaxError: invalid syntax
vinczente
commented
Jul 22, 2016
|
This is a example of generated code from pwiz class Flag(BaseModel): python will syntax error:
SyntaxError: invalid syntax |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
vinczente
Jul 22, 2016
Solution could be to escape the fields name and use a db_column property
flag_id = CharField(db_column='flag id', null=True)
vinczente
commented
Jul 22, 2016
|
Solution could be to escape the fields name and use a db_column property flag_id = CharField(db_column='flag id', null=True) |
vinczente commentedJul 21, 2016
in mysql fields can be named:
"source id"
"marketing/position"
in this case pwiz creates python model attributes of the same name.
Related issue: #184