File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## 1.0.0-rc.12 : 22.09.2024
4
4
5
- - ** Added** : FormField model declaration
5
+ - ** Added** : ` FormField ` population strategy
6
6
7
7
## 1.0.0-rc.11 : 16.08.2024
8
8
Original file line number Diff line number Diff line change @@ -214,8 +214,8 @@ def create_album(request):
214
214
form.populate(album)
215
215
216
216
# Save populated objects
217
- album.save()
218
217
album.artist.save()
218
+ album.save()
219
219
```
220
220
221
221
If you want example with whole Django project, check out repository created by [ pawl] ( https://github.com/pawl )
Original file line number Diff line number Diff line change @@ -148,7 +148,6 @@ def create_album(request):
148
148
form.populate(album)
149
149
150
150
# Save populated objects
151
- album.save()
152
151
album.artist.save()
153
-
152
+ album.save()
154
153
```
Original file line number Diff line number Diff line change @@ -58,8 +58,16 @@ def test_valid(self):
58
58
song = Song ()
59
59
form .populate (song )
60
60
61
+ song .album .artist .save ()
62
+ song .album .save ()
63
+ song .save ()
64
+
61
65
self .assertIsInstance (song .album , Album )
62
66
self .assertIsInstance (song .album .artist , Artist )
63
67
64
68
self .assertEqual (song .album .title , data ['album' ]['title' ])
65
69
self .assertEqual (song .album .artist .name , data ['album' ]['artist' ]['name' ])
70
+
71
+ self .assertEqual (song .pk , 1 )
72
+ self .assertEqual (song .album .pk , 1 )
73
+ self .assertEqual (song .album .artist .pk , 1 )
You can’t perform that action at this time.
0 commit comments