Karsten,
Thanks for your interest in the project—I'm glad it's been useful to
you and your company.
> 0) Please put a prominent link to this group on the google code site. <snip>
Thanks for the push to create this group, just hadn't got around to
it. I added a link to this group on the Google Code project after this
list had been created.
> 1) It would be great if required fields would have an additional
css
> class so they can be styled differently.
We want to let each project determine how their own templates display
the created forms, but it would be easy to add an {% if %} tag that
would check if the field is required and add a CSS class. I've updated
our template example code to show that:
http://code.google.com/p/django-dataforms/source/browse/trunk/example/templates/index.html
<div class="form-row{% if field.field.required %} required{% endif
%}">
> 2) If I have a MultiSelect field and create a binding to one of its
> choices, the binding only gets active if this choice is the only one
> selected. In my eyes this behaviour should be at least configurable,
> if it's not a bug at all.
Ya, I think that is a bug. Will you file a report on our issue
tracker? I'll look into it.
> 3) The use of validators is unclear to me. Could you provide a little
> example on how to use them?
The validation system is a little bit magical and I'll work on writing
some documentation for it. For now, if you take validation_example.py,
copy or rename it to validation.py and then run the example, I think
you'll get the idea. The validation is loaded dynamically if the
dataforms can import a module named "validation" and find a class name
that corresponds to the dataform slug it is processing (i.e.,
"PersonalInformationForm" is the class name in the validation module,
for the dataform with the slug of "personal-information-form"). Then,
inside that class, we just use Django's standards for form and field
validation (
http://docs.djangoproject.com/en/1.1/ref/forms/validation/
). The clean() method can perform dataform-level validation, and the
clean_field_slug() methods can perform field-level validation. These
methods are dynamically injected onto the form object when it's
created so that Django's own validation system can be used. Does that
make sense?
> 4) To generate tickets, I run render_to_string with a ticket template
> and form.cleaned_data. For choice fields, this includes only the
> choice values, but not the choice titles. To work around this, I
> created a small template filter (included below). Maybe it's of use to
> someone, feel free to include it into the package if it's worth it:
<snip>
Cool, good idea. Just thinking about it though, there's no guarantee
that a choice slug is unique (I don't think they should be—there are
probably many cases where different titles would use the same choice
value). So, the code of Choice.objects.get(value=value).title will
throw an exception if there are multiple Choices with the same slug.
> That's it for now, I'm sure I will find some more stuff while
> converting some of our old forms to d-df.
Thanks for your input, let me know if you have other issues. I like
the name "d-df", it's catchy. ;)
- Mike