Skip to content

Commit 558c1c2

Browse files
committed
fix CHANGELOG, minor docs changes and extended formfield population strategy test
1 parent ba7acc7 commit 558c1c2

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 1.0.0-rc.12 : 22.09.2024
44

5-
- **Added**: FormField model declaration
5+
- **Added**: `FormField` population strategy
66

77
## 1.0.0-rc.11 : 16.08.2024
88

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ def create_album(request):
214214
form.populate(album)
215215

216216
# Save populated objects
217-
album.save()
218217
album.artist.save()
218+
album.save()
219219
```
220220

221221
If you want example with whole Django project, check out repository created by [pawl](https://github.com/pawl)

docs/example.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ def create_album(request):
148148
form.populate(album)
149149

150150
# Save populated objects
151-
album.save()
152151
album.artist.save()
153-
152+
album.save()
154153
```

tests/test_formfield.py renamed to tests/test_population_formfield.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,16 @@ def test_valid(self):
5858
song = Song()
5959
form.populate(song)
6060

61+
song.album.artist.save()
62+
song.album.save()
63+
song.save()
64+
6165
self.assertIsInstance(song.album, Album)
6266
self.assertIsInstance(song.album.artist, Artist)
6367

6468
self.assertEqual(song.album.title, data['album']['title'])
6569
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)

0 commit comments

Comments
 (0)