Lessons about Django (page 20)
The links, tools and tips our engineers and designers share with each other, one “today I learned” at a time.
- lessons shared
- 288
- people sharing
- 29
- database started in
- 2016








Tech Insights
On Django, access form error codes in the template use the
as_dataattribute like this:{% for error in form.errors.as_data %}{{ error.code }}{% endfor %}Shared by
- Django

docs.djangoproject.com
You can pass a
update_fieldsparam to the modelsavemethod. One interesting use for this is to avoid updating dates in time stamped models.product.name = 'Name changed again' product.save(update_fields=['name']) #specifying-which-fields-to-save
Flávio Juvenal

Tech Insights· docs.djangoproject.com
You can pass a
update_fieldsparam to the modelsavemethod. One interesting use for this is to avoid updating dates in time stamped models.product.name = 'Name changed again' product.save(update_fields=['name'])Shared by
Read on docs.djangoproject.com- Django

hackernoon.com
Use
subTestin Python unittest when asserting inside loop: [#.425k66c9b](#.425k66c9b)Use subTest in Python unittest when asserting inside loop: #.425k66c9b
Filipe Ximenes

Tech Insights· hackernoon.com
Use
subTestin Python unittest when asserting inside loop: [#.425k66c9b](#.425k66c9b)Use
subTestin Python unittest when asserting inside loop: #.425k66c9bShared by
Read on hackernoon.com- Django
- Tests
Book a call
Found it useful?
Let’s put it to work.
Tell us about your product and the problem in front of you. We’ll bring what we’ve learned on real projects.
Tell us about your product, and we’ll bring what we’ve learned.
Still prefer the good old email? Contact us



