From 8379785e79c6d92baa02f5705009d38f1601c1e1 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 25 Nov 2006 06:33:59 +0000 Subject: [PATCH] Moved newforms form_for_model and form_for_fields to django/newforms/models.py git-svn-id: http://code.djangoproject.com/svn/django/trunk@4103 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/newforms/__init__.py | 13 +------------ django/newforms/models.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 django/newforms/models.py diff --git a/django/newforms/__init__.py b/django/newforms/__init__.py index 2a472d7b39..a445a21bfb 100644 --- a/django/newforms/__init__.py +++ b/django/newforms/__init__.py @@ -14,15 +14,4 @@ from util import ValidationError from widgets import * from fields import * from forms import Form - -########################## -# DATABASE API SHORTCUTS # -########################## - -def form_for_model(model): - "Returns a Form instance for the given Django model class." - raise NotImplementedError - -def form_for_fields(field_list): - "Returns a Form instance for the given list of Django database field instances." - raise NotImplementedError +from models import * diff --git a/django/newforms/models.py b/django/newforms/models.py new file mode 100644 index 0000000000..d99619c44a --- /dev/null +++ b/django/newforms/models.py @@ -0,0 +1,13 @@ +""" +Helper functions for creating Forms from Django models and database field objects. +""" + +__all__ = ('form_for_model', 'form_for_fields') + +def form_for_model(model): + "Returns a Form instance for the given Django model class." + raise NotImplementedError + +def form_for_fields(field_list): + "Returns a Form instance for the given list of Django database field instances." + raise NotImplementedError