# :banana: Django Bananas
*Django extensions the monkey way*
### Install
``` sh
$ pip install django-bananas
```
> **Note:** Currently bleeding edge, only tested in *Python 3.4* / *Django 1.8*, pull requests welcomed.
### Examples
#### Models
Abstract `TimeStampedModel` with date created/modified fields:
``` py
class Book(TimeStampedModel):
pass
book.date_created
book.date_modified
```
#### ORM
New `queryset.dicts()` with field renaming through kwargs, and *dot-dict* style results:
``` py
class Book(TimeStampedModel):
author = ForeignKey(Author)
objects = Manager.from_queryset(ExtendedQuerySet)()
>>> book = Book.objects.dicts('id', author='author__name').first()
{'id': 1, 'author': 'Jonas'}
>>> book.author
'Jonas'
```
#### Admin
Custom django admin stylesheet.
> **Note:** Work-in-progress! Only a few views styled and not tested cross-browser.
``` py
# settings.py
INSTALLED_APPS = (
'bananas', # Needs to be before 'django.contrib.admin'
'django.contrib.admin',
...
)
ADMIN = {
'SITE_HEADER': 'Bananas',
'SITE_TITLE': 'Bananas Admin',
'INDEX_TITLE': 'Admin Panel',
# 'BACKGROUND_COLOR': '#363c3f',
}
```
``` py
# urls.py
from bananas import admin
urlpatterns = [
...
url(r'^admin/', include(admin.site.urls)),
]
```
*Django extensions the monkey way*
### Install
``` sh
$ pip install django-bananas
```
> **Note:** Currently bleeding edge, only tested in *Python 3.4* / *Django 1.8*, pull requests welcomed.
### Examples
#### Models
Abstract `TimeStampedModel` with date created/modified fields:
``` py
class Book(TimeStampedModel):
pass
book.date_created
book.date_modified
```
#### ORM
New `queryset.dicts()` with field renaming through kwargs, and *dot-dict* style results:
``` py
class Book(TimeStampedModel):
author = ForeignKey(Author)
objects = Manager.from_queryset(ExtendedQuerySet)()
>>> book = Book.objects.dicts('id', author='author__name').first()
{'id': 1, 'author': 'Jonas'}
>>> book.author
'Jonas'
```
#### Admin
Custom django admin stylesheet.
> **Note:** Work-in-progress! Only a few views styled and not tested cross-browser.
``` py
# settings.py
INSTALLED_APPS = (
'bananas', # Needs to be before 'django.contrib.admin'
'django.contrib.admin',
...
)
ADMIN = {
'SITE_HEADER': 'Bananas',
'SITE_TITLE': 'Bananas Admin',
'INDEX_TITLE': 'Admin Panel',
# 'BACKGROUND_COLOR': '#363c3f',
}
```
``` py
# urls.py
from bananas import admin
urlpatterns = [
...
url(r'^admin/', include(admin.site.urls)),
]
```
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-bananas-1.0.3.tar.gz
(11.6 kB
view details)
File details
Details for the file django-bananas-1.0.3.tar.gz.
File metadata
- Download URL: django-bananas-1.0.3.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11b423b8e886303f14124af33caaaafd29d88d0372cc3cc1c042cf1ed352b666
|
|
| MD5 |
1336f30ee7d7e9ea3454dedd1466f03e
|
|
| BLAKE2b-256 |
c2df4f153ade57b6db20ea7a22ad6ac8e32ad25a1d2d53136a7e79264b3f997b
|