dfa
django-form-admin
pypi i django-form-admin
dfa

django-form-admin

It is a Django application that lets to render forms like django admin, with the same HTML

by Pablo Martín

0.5.1 (see all)License:LGPL 3
pypi i django-form-admin
Readme

.. contents::

=================

django-form-admin

Information

.. image:: https://badge.fury.io/py/django-form-admin.png :target: https://badge.fury.io/py/django-form-admin

.. image:: https://pypip.in/d/django-form-admin/badge.png :target: https://pypi.python.org/pypi/django-form-admin

It is a Django application that lets to render forms like django admin, with the same HTML

Requirements

  • Django <https://www.djangoproject.com/> (>= 1.0, the example project <https://github.com/Yaco-Sistemas/django-form-admin/tree/master/example> needs >=1.3)

How to use it

Option 1

In your form:

.. code-block:: python

class FooForm(forms.Form, FormAdminDjango):
    pass

class FooModelForm(forms.ModelForm, FormAdminDjango):
    pass

In your template:

.. code-block:: html+django

{{ form.as_django_admin }}

Option 2

But you don't need inherit of FormAdminDjango, you may also do

In your form:

.. code-block:: python

class FooForm(forms.Form):
    ...

    def as_django_admin(self):
        from formadmin.forms import as_django_admin
        return as_django_admin(self)

In your template:

.. code-block:: html+django

{{ form.as_django_admin }}

Option 3

Or even without modify the form

Only in your template:

.. code-block:: html+django

{% load formadmin_filters %}
{{ form|as_django_admin }}

Development

You can get the bleeding edge version of django-form-admin by doing a clone of its git repository::

git clone git://github.com/Yaco-Sistemas/django-form-admin.git

Releases

0.5.1 (2018-03-05)

  • Fix previous version (Django support > 1.8)

0.5.0 (2018-03-05)

  • Django support > 1.8 (1.9 - 1.11)
  • Improve readme file
  • Thanks to:
    • bashu <https://github.com/bashu>_
    • predatell <https://github.com/predatell>_

0.4.2 (2013-10-28)

  • Fix an error when to install this egg from pypi

0.4.1 (2013-10-04)

  • Improvements in the example project

0.4.0 (2013-09-12)

  • New way to render the form (filter)
  • Update metainfo
  • Example project

0.3.2 (2011-12-03)

  • Subversion version

GitHub Stars

13

LAST COMMIT

4yrs ago

MAINTAINERS

1

CONTRIBUTORS

4

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
0.5.1
4yrs ago
0.5.0
4yrs ago
0.4.2
9yrs ago
0.4.1
9yrs ago
No alternatives found
No tutorials found
Add a tutorial