parent
dcee65eab5
commit
40affcaea3
46
README.md
46
README.md
|
|
@ -199,17 +199,17 @@ If you previously used Django Admin Sortable, **DON'T PANIC** - everything will
|
||||||
Please note however that the `Sortable` class still contains the hard-coded `order` field, and meta inheritance requirements:
|
Please note however that the `Sortable` class still contains the hard-coded `order` field, and meta inheritance requirements:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
# legacy model definition
|
# legacy model definition
|
||||||
|
|
||||||
from adminsortable.models import Sortable
|
from adminsortable.models import Sortable
|
||||||
|
|
||||||
class Project(Sortable):
|
class Project(Sortable):
|
||||||
class Meta(Sortable.Meta):
|
class Meta(Sortable.Meta):
|
||||||
pass
|
pass
|
||||||
title = models.CharField(max_length=50)
|
title = models.CharField(max_length=50)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.title
|
return self.title
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Model Instance Methods
|
#### Model Instance Methods
|
||||||
|
|
@ -409,8 +409,8 @@ change_list_template_extends
|
||||||
These attributes have default values of:
|
These attributes have default values of:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
change_form_template_extends = 'admin/change_form.html'
|
change_form_template_extends = 'admin/change_form.html'
|
||||||
change_list_template_extends = 'admin/change_list.html'
|
change_list_template_extends = 'admin/change_list.html'
|
||||||
```
|
```
|
||||||
|
|
||||||
If you need to extend the inline change form templates, you'll need to select the right one, depending on your version of Django. For Django 1.5.x or below, you'll need to extend one of the following:
|
If you need to extend the inline change form templates, you'll need to select the right one, depending on your version of Django. For Django 1.5.x or below, you'll need to extend one of the following:
|
||||||
|
|
@ -460,7 +460,7 @@ plugin_pool.register_plugin(CMSCarouselPlugin)
|
||||||
The contents of `sortable-stacked-inline-change-form.html` at a minimum need to extend
|
The contents of `sortable-stacked-inline-change-form.html` at a minimum need to extend
|
||||||
the extrahead block with:
|
the extrahead block with:
|
||||||
|
|
||||||
```html
|
```html+django
|
||||||
{% extends "admin/cms/page/plugin_change_form.html" %}
|
{% extends "admin/cms/page/plugin_change_form.html" %}
|
||||||
{% load static from staticfiles %}
|
{% load static from staticfiles %}
|
||||||
|
|
||||||
|
|
@ -477,40 +477,40 @@ the extrahead block with:
|
||||||
|
|
||||||
Sorting within Django-CMS is really only feasible for inline models of a plugin as Django-CMS already includes sorting for plugin instances. For tabular inlines, just substitute:
|
Sorting within Django-CMS is really only feasible for inline models of a plugin as Django-CMS already includes sorting for plugin instances. For tabular inlines, just substitute:
|
||||||
|
|
||||||
```html
|
```html+django
|
||||||
<script src="{% static 'adminsortable/js/admin.sortable.stacked.inlines.js' %}"></script>
|
<script src="{% static 'adminsortable/js/admin.sortable.stacked.inlines.js' %}"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
with:
|
with:
|
||||||
|
|
||||||
```html
|
```html+django
|
||||||
<script src="{% static 'adminsortable/js/admin.sortable.tabular.inlines.js' %}"></script>
|
<script src="{% static 'adminsortable/js/admin.sortable.tabular.inlines.js' %}"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
From ``django-cms 3.x`` the path of change_form.html has changed. Replace the follwing line:
|
From ``django-cms 3.x`` the path of change_form.html has changed. Replace the follwing line:
|
||||||
|
|
||||||
```html
|
```html+django
|
||||||
{% extends "admin/cms/page/plugin_change_form.html" %}
|
{% extends "admin/cms/page/plugin_change_form.html" %}
|
||||||
```
|
```
|
||||||
|
|
||||||
with
|
with
|
||||||
|
|
||||||
```html
|
```html+django
|
||||||
{% extends "admin/cms/page/plugin/change_form.html" %}
|
{% extends "admin/cms/page/plugin/change_form.html" %}
|
||||||
```
|
```
|
||||||
|
|
||||||
From ``django-admin-sortable 2.0.13`` the ``jquery.django-csrf.js`` was removed and you have to include the snippet-template.
|
From ``django-admin-sortable 2.0.13`` the ``jquery.django-csrf.js`` was removed and you have to include the snippet-template.
|
||||||
Change the following line:
|
Change the following line:
|
||||||
|
|
||||||
```html
|
```html+django
|
||||||
<script type="text/javascript" src="{% static 'adminsortable/js/jquery.django-csrf.js' %}"></script>
|
<script type="text/javascript" src="{% static 'adminsortable/js/jquery.django-csrf.js' %}"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
to
|
to
|
||||||
|
|
||||||
```html
|
```html+django
|
||||||
{% include 'adminsortable/csrf/jquery.django-csrf.html' with csrf_cookie_name='csrftoken' %}
|
{% include 'adminsortable/csrf/jquery.django-csrf.html' with csrf_cookie_name='csrftoken' %}
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note, if you change the ``CSRF_COOKIE_NAME`` you have to adjust ``csrf_cookie_name='YOUR_CSRF_COOKIE_NAME'``
|
Please note, if you change the ``CSRF_COOKIE_NAME`` you have to adjust ``csrf_cookie_name='YOUR_CSRF_COOKIE_NAME'``
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue