Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django 1.6 compat and fixed packaging #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
*.pyc
*~
example/db.sqlite
example/db.sqlite
django_admincommand.egg-info
.ropeproject
build/
dist/
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include README.rst

recursive-include admincommand/templates *
17 changes: 9 additions & 8 deletions admincommand/admin.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# -*- coding: utf-8 -*-
from functools import update_wrapper

from django.contrib import admin
from django.shortcuts import render
from django.contrib.admin.options import csrf_protect_m
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import redirect
from django.conf.urls.defaults import url
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.http import HttpResponseBadRequest
from django.conf.urls.defaults import patterns
try:
from django.conf.urls import url, patterns
except ImportError:
from django.conf.urls.defaults import url, patterns
from django.utils.encoding import force_unicode
from django.utils.functional import update_wrapper
from django.http import HttpResponseForbidden
from django.utils.safestring import mark_safe
from django.contrib import messages
Expand All @@ -25,9 +26,9 @@
class AdminCommandAdmin(SneakAdmin):
list_display = ('command_name',)

def queryset(self, request):
def get_queryset(self, request):
# user current user to construct the queryset
# so that only commands the user can execute
# so that only commands the user can execute
# will be visible
return CommandQuerySet(request.user)

Expand Down
22 changes: 22 additions & 0 deletions admincommand/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
]

operations = [
migrations.CreateModel(
name='AdminCommand',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
],
options={
'abstract': False,
},
),
]
Empty file.
5 changes: 4 additions & 1 deletion example/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from django.conf.urls.defaults import patterns, include, url
try:
from django.conf.urls import url, patterns, include
except ImportError:
from django.conf.urls.defaults import url, patterns, include

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
Expand Down
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
import os
from distutils.core import setup
from setuptools import setup, find_packages


def read(fname):
Expand All @@ -15,8 +15,7 @@ def read(fname):
author='Djaz Team',
author_email='[email protected]',
url='https://github.com/liberation/django-admincommand',
packages=['admincommand'],
data_files=[('admincommand/templates/admincommand', [
'admincommand/templates/admincommand/output.html',
'admincommand/templates/admincommand/run.html'])]
packages=find_packages(),
include_package_data=True,
zip_safe=False
)