Skip to content

depaolim/django_smart_raw_id

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Based on first idea and implementation from Marco Beri and Stefano Brentegani here packaged as a django app with some test cases added

Setup

Download the repo:

git clone https://github.com/depaolim/django_smart_raw_id.git

Add this folder to your pythonpath

The app is tested on Django 1.6 and has no dependency from other packages (apart from django itsef)

Usage in your projects

In your project do the following steps:

  1. Add the app smart_raw_id to INSTALLED_APPS in your settings.py

  2. Use SmartRawIdMixin as a mixin class for your model admin classes

Sample Usage

The following is an an example of usage in your admin.py

from smart_raw_id import SmartRawIdMixin

class SingleSaleAdmin(SmartRawIdMixin, ModelAdmin):
    list_display = ('id', 'product', 'price')
    raw_id_fields = ('product', )

Deploy

To deploy remember to do:

python manage.py collectstatic

Test

To run tests you need selenium as stated by requirements_dev.txt

pip install -r requirements_dev.txt
cd django_smart_raw_id
python manage.py test

LiveServerTestCase and selenium could have timeout problems. In such case you must restart the test

About

an extension for django raw_id widget

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published