Any downside to create a model object without saving?


(Erik Brown) #1

Okay, perhaps a silly question. I’m creating a model object with

obj = form.save(commit = false)

Then, based on some criteria, I redirect to another page and never save() the object. Is that okay? My assumption is that the object is eventually discarded and never stored. Are the any downsides to this approach?

Before you ask, I have some methods in the model that help me determine whether it is worth saving or not. So while I could do my calculations without creating a model object, it is easier to have the object available.

I assume this is fine, just wondering if there are any performance or integrity issues I should care about?

Thanks in advance,

Erik