For example this chunk of code:
new_log = ActivityLog(user=self.user,
activity=activity)
new_log.save()
Can I chain it to be like new_log = ActivityLog(…).save() ?
I believe I tried the above, but it doesn’t work. Is there a way to make it a 1 liner?
Django provides a convenience method on the model manager for just this purpose 🙂
The docs on create are here. It is billed as: