This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Django Bananas - Django extensions the monkey way

Project Description

Install

django-bananas is on PyPI, so just run:

pip install django-bananas

Compatibility

Currently bleeding edge, tested in

  • Django 1.8 under Python 3.4

pull requests welcome!

Examples

Models

Abstract TimeStampedModel with date created/modified fields:

Use TimeStampedModel as base class for your model

from bananas.models import TimeStampedModel

class Book(TimeStampedModel):
    pass

the timestamps can be accessed on the model as

>>> book.date_created
>>> book.date_modified

ORM

New queryset.dicts() with field renaming through kwargs, and dot-dict style results:

from bananas.query import ExtendedQuerySet

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.

Warning

Work in progress. Only a few views styled completely as of now.

# 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',
}
# your main urls.py
from bananas import admin

urlpatterns = [
    ...
    url(r'^admin/', include(admin.site.urls)),
]
Release History

Release History

History Node

1.0.12b1

History Node

1.0.11rc1

History Node

1.0.10rc1

History Node

1.0.9b4

History Node

1.0.9b3

History Node

1.0.9b2

History Node

1.0.9b1

This version
History Node

1.0.8

History Node

1.0.7

History Node

1.0.6

History Node

1.0.5

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_bananas-1.0.8-py3-none-any.whl (18.2 kB) Copy SHA256 Checksum SHA256 py3 Wheel May 13, 2015
django-bananas-1.0.8.tar.gz (14.3 kB) Copy SHA256 Checksum SHA256 Source May 13, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting