├── dfs ├── models.py ├── tests.py ├── management │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ └── formscaffold.py ├── sofa.py ├── __init__.py └── scaffold.py ├── LICENSE ├── setup.py └── README.rst /dfs/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dfs/tests.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dfs/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dfs/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dfs/sofa.py: -------------------------------------------------------------------------------- 1 | """Just a joke module, as I shortened the namespace for django-form-scaffold 2 | to `dfs`, in the UK there is a chain of sofa retailers called DFS. 3 | This module will print out a nice ASCII sofa (and lamp & chair) on import 4 | similar to the builtin `this` module. 5 | """ 6 | 7 | print r""" 8 | ____ 9 | / \ 10 | /______\ 11 | || 12 | || 13 | /~~~~~~\ || /~~~~~~~~~~~~~~~\ 14 | /~ ( )( ) ~\ || /~ ( )( )( )( )( ) ~\ 15 | (_)======(_) || (_)===============(_) 16 | |________| _||_ |_________________| 17 | """ 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 Wesley Mason 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | """Installer for django-form-scaffold""" 2 | 3 | from setuptools import setup, find_packages 4 | 5 | setup( 6 | name='django-form-scaffold', 7 | description='Helper functions for generating templated markup of Django forms', 8 | version='1.1.0', 9 | author='Wes Mason', 10 | author_email='wes[at]1stvamp[dot]org', 11 | url='http://github.com/1stvamp/django-form-scaffold', 12 | packages=find_packages(), 13 | license='Apache License 2.0', 14 | classifiers=( 15 | 'Framework :: Django', 16 | 'Intended Audience :: Developers', 17 | 'Intended Audience :: System Administrators', 18 | 'Operating System :: OS Independent', 19 | 'Topic :: Software Development', 20 | ), 21 | zip_safe=False, 22 | ) 23 | -------------------------------------------------------------------------------- /dfs/management/commands/formscaffold.py: -------------------------------------------------------------------------------- 1 | """ 2 | Wrapper to call scaffold from the commandline to dynamically generate:: 3 | from dfs import scaffold 4 | from app_name.forms import CustomForm 5 | form = CustomForm() 6 | print scaffold.as_ul(form) 7 | """ 8 | 9 | from dfs import scaffold 10 | from django.core.management.base import BaseCommand, CommandError 11 | 12 | def do_import(name): 13 | mod = __import__(name) 14 | components = name.split('.') 15 | for comp in components[1:]: 16 | mod = getattr(mod, comp) 17 | return mod 18 | 19 | class Command(BaseCommand): 20 | help = "Wrapper to call form scaffolding from the commandline, e.g.\nformscaffold my_app.forms MyForm as_p" 21 | args = "