Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
baseplate-admin committed Oct 12, 2024
1 parent 128d9ac commit 1ebb982
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# django-admin-hstore-widget

FormField that properly render HStoreField Data in django Admin based on [`djangoauts package`](https://github.com/djangonauts/django-hstore) and updated fork of [`django-admin-hstore-widget`](https://github.com/PokaInc/django-admin-hstore-widget)

## Requirements

- Python 3.9 and Up ( well technically any python version from 3.6 should work )
- Django 3.2 and Up

Using pip:

```bash
pip install django-admin-hstore-widget-2
```

## Installation

```python

# settings.py

INSTALLED_APPS = [
...,
'django_admin_hstore_widget',
...
]

```

## Usage

```python
# yourmodel/admin.py
from django.contrib import admin
from django import forms

from django_admin_hstore_widget.forms import HStoreFormField
from models import Yourmodel

class MyModelAdminForm(forms.ModelForm):
my_hstore_field = HStoreFormField()

class Meta:
model = Yourmodel
exclude = ()

@admin.register(Yourmodel)
class YourmodelAdmin(admin.ModelAdmin):
form = MyModelAdminForm

```

## Result

![Rendered result](./assets/rendered.png)

0 comments on commit 1ebb982

Please sign in to comment.