Skip to main content

Model and form fields to store values of multiple fields in dictionary

Project description

# Form field with variable list of rows

Requires Django framework and jQuery javascript library.

## Installation

```
pip install dynamicinputs
```

## Usage
Add "dynamicinputs" to installed apps in django settings file:

```python
INSTALLED_APPS = (
...
'dynamicinputs',
...
)
```

Then it can be used in model:

```python
from dynamicinputs import DynamicInputField

parent_names = DynamicInputField(
fields.CharField(
label="Names and addresses of parent companies",
widget=widgets.Textarea(),
help_text="If your publishing company has no parent companies then enter 'none'"),
max_count=10,
button='Add company')
)
```

Include required css and js files into your template:

```
{% load static %}

<link href="{% static 'dynamicinputs/dynamicinputs.css' %}" rel="stylesheet"/>
<script type="text/javascript" src="{% static 'dynamicinputs/dynamicinputs.js' %}"></script>
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-dynamicinputs-2.2.2.tar.gz (6.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page