You *can* use ModelForms for this. You don't need an active instance.

Iterate over the days in the month, and if you have an instance in your
database you instantiate a ModelForm where "instance=thing." If not, you
instantiate a ModelForm that has no instance, and you send as data ""
(empty string) for the entry and the proper date for the ref_date. You can
use the data kwarg when creating the ModelForm -- just as you'd send
"request.POST" into it.

When you receive the forms back in POST, you validate and save the forms.
Override the save() method of your ModelForm so that, if "entry" is blank
you don't save it. Incidentally, you should also check if it already exists
for that date and delete it in that case.

You can have multiple forms using "prefix," which could just be the date as
a string.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOzwKwFmrjn-i9WjEbxKhr6x7iLQuD0tXeBeYa_mcJs3ffpnpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to