Skip to content

Commit

Permalink
support for django 1.6, updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nanvel committed May 26, 2016
1 parent 09df99d commit bf6167d
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ db.sqlite3
dist/
app_media/
.env
venv
.idea
9 changes: 4 additions & 5 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Current or previous core committers
Contributors (in alphabetical order):

Oleksandr Polyeno ([email protected])
Yaroslav Klyuyev ([email protected])
Alex Vykalyuk ([email protected])

Contributors (in alphabetical order)
Oleksandr Polieno ([email protected])
Saurabh Kumar ([email protected])
Yaroslav Klyuyev ([email protected])

* Your name could stand here :)
6 changes: 6 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@
- niceEdit options can now be set in widget init method
- added example of admin widget usage
- updated js code

==== 0.24 ===

- docs improvements
- support for django 1.6
- updated AUTHORS
63 changes: 35 additions & 28 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ NicEdit widget for django with image upload feature.

NicEdit home: `http://nicedit.com/ <http://nicedit.com/>`__

Blog post: `http://nanvel.com/b/1377388800 <http://nanvel.com/b/1377388800>`__
Blog post: `NicEdit widget for Django <http://nanvel.name/2013/08/django-nicedit>`__

Versions
--------

0.24 - use with Django==1.6

Installation
------------
Expand All @@ -27,8 +32,7 @@ Add ``nicedit`` to your ``INSTALLED_APPS``
.. code-block:: python
INSTALLED_APPS = (
...,
'south',
...
'nicedit',
)
Expand Down Expand Up @@ -78,7 +82,8 @@ forms.py:
class MessageForm(forms.Form):
message = forms.CharField(
widget=NicEditWidget(attrs={'style': 'width: 800px;'}))
widget=NicEditWidget(attrs={'style': 'width: 800px;'})
)
views.py:

Expand All @@ -99,18 +104,18 @@ template:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>NicEdit widget</title>
{{ form.media }}
</head>
<body>
<form action='.' method='post'>
{% csrf_token %}
{{ form.message }}
<button type="submit">Submit</button>
</form>
</body>
<head>
<meta charset="utf-8">
<title>NicEdit widget</title>
{{ form.media }}
</head>
<body>
<form action='.' method='post'>
{% csrf_token %}
{{ form.message }}
<button type="submit">Submit</button>
</form>
</body>
</html>


Expand All @@ -120,33 +125,35 @@ Usage in admin:

.. code-block:: python
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from django import forms
from django.contrib import admin
from django.contrib import admin
from nicedit.widgets import NicEditAdminWidget
from nicedit.widgets import NicEditAdminWidget
from .models import Item
from .models import Item
class ItemAdminForm(forms.ModelForm):
class ItemAdminForm(forms.ModelForm):
class Meta:
model = Item
widgets = {
class Meta:
model = Item
widgets = {
'text': NicEditAdminWidget(
attrs={'style': 'width: 610px;'},
js_options={"buttonList": [
'save', 'bold', 'italic', 'underline', 'left', 'center',
'right', 'justify', 'ol', 'ul', 'fontSize', # 'fontFamily',
'fontFormat', 'indent', 'outdent', 'image', 'upload', 'link',
'unlink', 'forecolor', 'bgcolor', 'xhtml']}
),
'unlink', 'forecolor', 'bgcolor', 'xhtml']
}
)
}
class ItemAdmin(admin.ModelAdmin):
class ItemAdmin(admin.ModelAdmin):
form = ItemAdminForm
form = ItemAdminForm
Contribute
Expand Down
2 changes: 1 addition & 1 deletion nicedit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = '0.23'
__version__ = '0.24'
2 changes: 1 addition & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Django>=1.4,<1.6
Django>=1.4,<1.7
South
Pillow
2 changes: 1 addition & 1 deletion testproject/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Django
Django==1.6
South
PIL

0 comments on commit bf6167d

Please sign in to comment.