You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the field is 'id' and the Column was initialized upper case as 'ID' (Of course I can make it lower case in this situation and it works)
So I'm just learning alchemy & wtforms - but this seems to rely on an unspoken naming convention (or at least consistency through the stack) - naming the PK field the same as the db column. This is not otherwise a requirement and took me a bit to figure out what was happening.
So my question is, can/should this be looking at the names of the fields instead of the internal column name? Or is this by design and I'm just missing something.
The text was updated successfully, but these errors were encountered:
If I have a model with a field declared (note upper case "ID"):
id = db.Column('ID', db.Integer, primary_key=True)
And an associated ModelForm with a field:
id = IntegerField()
When I post back the form (unchanged, for testing), it tries to recreate the row because it's not matching up to the existing row here:
wtforms-alchemy/wtforms_alchemy/utils.py
Line 105 in d619202
Because the field is 'id' and the Column was initialized upper case as 'ID' (Of course I can make it lower case in this situation and it works)
So I'm just learning alchemy & wtforms - but this seems to rely on an unspoken naming convention (or at least consistency through the stack) - naming the PK field the same as the db column. This is not otherwise a requirement and took me a bit to figure out what was happening.
So my question is, can/should this be looking at the names of the fields instead of the internal column name? Or is this by design and I'm just missing something.
The text was updated successfully, but these errors were encountered: