Skip to main content

Django Admin File Wiget for Zappa based admin panels

Project description

=============================
Django Zappa File Widget
=============================

.. image:: https://badge.fury.io/py/zappa-file-widget.png
:target: https://badge.fury.io/py/zappa-file-widget

.. image:: https://travis-ci.org/anush0247/zappa-file-widget.png?branch=master
:target: https://travis-ci.org/anush0247/zappa-file-widget

Django Admin File Wiget for Zappa based admin panels

Documentation
-------------

The full documentation is at https://zappa-file-widget.readthedocs.org.

Quickstart
----------

Install Django Zappa File Widget::

pip install zappa-file-widget

Then use it in a project::

``settings.py``

```py

INSTALLED_APPS += "zappa_file_widget"

```

``models.py``

```python

from django.db import models


class Order(models.Model):
attachment = models.FileField(upload_to="media/")
ordered_by = models.CharField(max_length=20)

def __unicode__(self):
return unicode(self.attachment)


```

``admin.py``

```python

from django import forms
from django.contrib import admin

from zappa_file_widget.file_widget import FileWidget
from django_custom_admin.models import Order


class OrderForm(forms.ModelForm):
class Meta:
widgets = {
'attachment': FileWidget(),
}


class OrderAdmin(admin.ModelAdmin):
form = OrderForm


admin.site.register(Order, OrderAdmin)

```

```sh
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
```


Point your browser at : [http://127.0.0.1:8000/admin/example/order/](http://127.0.0.1:8000/admin/example/order/)


Credits
---------

Tools used in rendering this package:

* Cookiecutter_
* `cookiecutter-djangopackage`_

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage




History
-------

0.1.0 (2016-08-26)
++++++++++++++++++

* First release on PyPI.

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

zappa-file-widget-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zappa_file_widget-0.1.0-py2.py3-none-any.whl (5.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file zappa-file-widget-0.1.0.tar.gz.

File metadata

File hashes

Hashes for zappa-file-widget-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c7fb83c3d300efb386d3280895cee649c8892cae940b50a72bf2b6f8837757ec
MD5 efa679c486d501016bebb60523641b1b
BLAKE2b-256 c0bb2c21da9f7daa8c70f854f30fd70ae6b2e512081824607e68ae8447964ea2

See more details on using hashes here.

File details

Details for the file zappa_file_widget-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for zappa_file_widget-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 61f985bc73108ce39df80f3eb3a2aaf52672f9f5d8fe70fd593c643c68ebaa0b
MD5 243094cb1e5a88a9936234f59d2e047e
BLAKE2b-256 12633995501c710897ed0a4d029ecf04cce957dbf3ee2fc03a4cd9406f8cf633

See more details on using hashes here.

Supported by

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