This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

django admin mixin

Модуль реализует механизм примесей (mixin) для Django admin. С помощью модуля можно упростить конфигурацию admin.py

Применение:

Если у вас есть много моделей, которые имеют повторяющиеся поля. С этими полями как-то надо работать в админке, например, фильтровать, искать по ним. То вы можете вынести этот повторяющийся блок в mixin.

Install

pip install django-admin-mixin

Configuration

Usage

Example models:

# models.py

class SuperModel1(models.Model):
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    value1 = models.CharField(max_length=25)
    value2 = models.FloatField()


class SuperModel2(models.Model):
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    super_val1 = models.CharField(max_length=120)
    super_val2 = models.FloatField()

Example admin.py:

# admin.py
from django.contrib import admin
from super_app.models import SuperModel1, SuperModel2
from django_admin_mixin import MixinAdminCombiner

class TimeMixinAdmin(admin.ModelAdmin):
    list_display = ['created_at']
    ordering = ['-created_at']
    list_filter = ['created_at', 'updated_at']

@admin.register(SuperModel1)
class SuperModel1Admin(MixinAdminCombiner):
    mixins = [TimeMixinAdmin, ]
    list_display = ['value1']


@admin.register(SuperModel2)
class SuperModel2Admin(MixinAdminCombiner):
    mixins = [TimeMixinAdmin, ]
    list_display = ['super_val1', 'super_val2']

Result:

<image>

Features

  • TODO

History

0.1.0 (2016-09-24)

  • First release on PyPI.
Release History

Release History

0.1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_admin_mixin-0.1.2-py2.py3-none-any.whl (5.8 kB) Copy SHA256 Checksum SHA256 3.5 Wheel Oct 5, 2016
django-admin-mixin-0.1.2.tar.gz (14.1 kB) Copy SHA256 Checksum SHA256 Source Oct 5, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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