#27: Single form field for multiple database fields -----------------------------------------+---------------------- Reporter: adrian | Owner: nobody Type: New feature | Status: new Milestone: | Component: Forms Version: | Severity: Normal Resolution: | Keywords: Triage Stage: Someday/Maybe | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | -----------------------------------------+----------------------
Comment (by anonymous): I would not tie this kind of information to the Model. What would you say about the following syntax? {{{ class PersonForm(forms.ModelForm): full_name = forms.CharField() class Meta: exclude = ('first_name', 'last_name',) aggregation = { 'full_name': '%(last_name)s, %(first_name)s', } }}} There would be no {{{'full_name'}}} key in {{{PersonForm.cleaned_data}}}, but {{{'first_name'}}} and {{{'last_name'}}}. Validation errors (like incompatibility with format string) would be raised for the {{{full_name}}} field. -- Ticket URL: <http://code.djangoproject.com/ticket/27#comment:12> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.