# :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.6.tar.gz
(13.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-bananas-1.0.6.tar.gz.
File metadata
- Download URL: django-bananas-1.0.6.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b3f1af883091306f623816f93e40ec71b58a77a8b6550d6b804e6266565641a
|
|
| MD5 |
1db6358b07191ba0b63277fed238866b
|
|
| BLAKE2b-256 |
ce2978c92c52b567c2a0985e322d05242c62321dd02502ea752bddf3e0444f0b
|
File details
Details for the file django_bananas-1.0.6-py3-none-any.whl.
File metadata
- Download URL: django_bananas-1.0.6-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb1a9d6fedbd6198c7a31a5d8fc2cf1b23f1d60876a5a24795fe2d02be245b6a
|
|
| MD5 |
d7540ff188518be1473018e049d1e9f1
|
|
| BLAKE2b-256 |
18dda86e9a4954fd547bc09f53e6711fd24491a5c5757e1e020b1157a946881c
|