Commit 660698f
fix: populate __fillable__ from full MRO, not just own annotations
__init_subclass__ previously built __fillable__ from cls.__annotations__
which only contains annotations declared directly in the class body.
Fields inherited from an intermediate base model were silently absent,
causing fill() / update() to skip them with no error.
Fix: walk the MRO with klass.__dict__.get('__annotations__', {}),
collecting annotations from every user-defined ancestor while stopping
at Model and its own bases (so framework internals like db_manager,
created_at, updated_at are excluded).
Also reverts the earlier incorrect update() change — fill(attributes).save()
is the right implementation; the problem was always in __fillable__ not
being populated correctly.
Closes #67
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 8243951 commit 660698f
7 files changed
Lines changed: 75 additions & 392 deletions
File tree
- fastapi_startkit
- src/fastapi_startkit
- masoniteorm.backup/tests
- factories
- integrations
- config
- databases/migrations
- masoniteorm/models
- tests/masoniteorm/models
Lines changed: 0 additions & 66 deletions
This file was deleted.
Lines changed: 0 additions & 119 deletions
This file was deleted.
Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 0 additions & 70 deletions
This file was deleted.
Lines changed: 17 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
35 | 50 | | |
36 | | - | |
| 51 | + | |
37 | 52 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
| |||
200 | 211 | | |
201 | 212 | | |
202 | 213 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 214 | + | |
207 | 215 | | |
208 | 216 | | |
209 | 217 | | |
| |||
0 commit comments