QueryBuilder with model specified does not default to using the model's table #914
Labels
enhancement
A feature that exists, works as intended but needs to be improved
feature request
A feature that does not yet exist but will be a good addition to the library
Describe the feature as you'd like to see it
When a model= is specified in the constructor for a QueryBuilder and no table is explicitly specified by table() then the builder should default to using the model's table.
What do we currently have to do now?
In the current code it is necessary to redundantly specify the table or it defaults to None. This causes exceptions and causes join() etc. to produce broken SQL.
Additional context
When the model is given it is more reasonable to expect that its table will be used. This commit proposes code to fix.
b3f9bca
No. Explicit table() could still override
The text was updated successfully, but these errors were encountered: