List of Dictionaries Model Field for Django
Project description
Django-LODField
------------------
A Django model representation for a list of python objects.
##### 1) Installation
```
pip install django-lodfield
```
or
```
git clone https://github.com/nakule/django-lodfield.git django-lodfield
cd django-lodfield
python setup.py install
```
##### 2) Import the List of Dictionary (LOD) model field
```
from LODField import LODField
```
##### 3) Define the model Field
```
class Invoice(models.Model):
paid = models.BooleanField(default=False)
# Simple Usage
invoice_lines = LODField(max_length=10000)
# Set Limit for Admin Form
invoice_lines = LODField(max_length=10000, lines=10)
# Set Fields for the Dictionaries in the List
invoice_lines = LODField(max_length=10000, lines=10,
keys=["Description", "Amount in Cents",
"Amount in Dollars"])
```
##### 4) Register Model to the Django Admin Interface (Optional)
```
from django.contrib import admin
admin.site.register(Invoice)
```
------------------
A Django model representation for a list of python objects.
##### 1) Installation
```
pip install django-lodfield
```
or
```
git clone https://github.com/nakule/django-lodfield.git django-lodfield
cd django-lodfield
python setup.py install
```
##### 2) Import the List of Dictionary (LOD) model field
```
from LODField import LODField
```
##### 3) Define the model Field
```
class Invoice(models.Model):
paid = models.BooleanField(default=False)
# Simple Usage
invoice_lines = LODField(max_length=10000)
# Set Limit for Admin Form
invoice_lines = LODField(max_length=10000, lines=10)
# Set Fields for the Dictionaries in the List
invoice_lines = LODField(max_length=10000, lines=10,
keys=["Description", "Amount in Cents",
"Amount in Dollars"])
```
##### 4) Register Model to the Django Admin Interface (Optional)
```
from django.contrib import admin
admin.site.register(Invoice)
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-lodfield-1.0.3.tar.gz
(4.5 kB
view details)
File details
Details for the file django-lodfield-1.0.3.tar.gz.
File metadata
- Download URL: django-lodfield-1.0.3.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f52b384b6132d2a54d1ab27d341a0d7bf7969e758956adfcc044ea97b752c839
|
|
| MD5 |
48543f08a148789684cf7a73b9ced9e9
|
|
| BLAKE2b-256 |
7a99b9674890155bd7387d668691342c9ba92248b9f6449c0f9242b0be0ecc5f
|