Permalink
Browse files

Merge branch 'develop' into upstream/better_urlpattern

  • Loading branch information...
2 parents ad125a6 + f23a2e6 commit de294685bc9ee9bf8aa0f5ffea838b5c81c56e44 @neoascetic committed Oct 4, 2012
Showing 348 changed files with 33,886 additions and 19,666 deletions.
View
@@ -30,7 +30,7 @@ eggs
parts
bin
/dist
-*.rst~
+*~
/docs/*.html
distribute-*.tar.gz
include/
View
@@ -1,12 +1,13 @@
language: python
python:
+ - "2.5"
- "2.6"
- "2.7"
env:
- - DJANGO="django>=1.3,<1.4"
- - DJANGO="django>=1.4,<1.5"
+ - DJANGO=test_requirements/django-1.3.txt
+ - DJANGO=test_requirements/django-1.4.txt
install:
- - pip install -q $DJANGO django-mptt==0.5.1 django-reversion==1.6 django-classy-tags==0.3.4.1 django-sekizai==0.6.1 html5lib==0.95 jinja2==2.6 PIL==1.1.7 pygments==1.5 south==0.7.5 sphinx==1.1.3 argparse
+ - pip install -q -r $DJANGO --use-mirrors
script:
python runtests.py
notifications:
View
@@ -4,7 +4,7 @@ source_file = cms/locale/en/LC_MESSAGES/djangojs.po
source_lang = en
[main]
-host = http://www.transifex.net
+host = https://www.transifex.com
[django-cms.core]
file_filter = cms/locale/<lang>/LC_MESSAGES/django.po
View
@@ -26,6 +26,7 @@ Contributors (in alphabetical order):
* Alberto Paro
* Alessandro Ronchi
* Aleš Kocjančič
+* Alex Cucu
* Alexandre Leray
* Alexey Subbotin
* Alvin Mites
@@ -91,6 +92,7 @@ Contributors (in alphabetical order):
* Ian Lewis
* indexofire
* Ionel Cristian Maries
+* Iván Raskovsky
* Ivan Vershigora
* izi
* Jameel Al-Aziz
@@ -152,6 +154,7 @@ Contributors (in alphabetical order):
* Paolo
* Patrick Toal
* Paul van der Linden
+* Pavel Puchkin
* pbgc
* Pedro Gracia
* Pete Loggie
View
@@ -85,3 +85,42 @@
==== 2.3.1 ====
- pinned version of django-mptt to 0.5.1 or 0.5.2
+
+==== 2.3.2 ====
+
+- MIGRATION: 0036_auto__add_field_cmsplugin_changed_date.py - new field changed_date on CMSPlugin
+- CMS_FRONTEND_LANGUAGES limits django languages as well during language selection
+- Wymeditor updated to 1.0.4a
+- icon_url escape fixed
+- Ukranian translation added
+- Fixed wrong language prefix handling for form actions and admin preview
+- Admin icons in django 1.4 fixed
+- Added requirements.txt for pip and testing in test_requirements
+- Google map plugin with height and width properties. Migrations will set default values on not-null fields.
+- Docs fixes
+- Code cleanup
+- Switched html5lib to HTML serializer
+- Removed handling of iterables in plugin_pool.register_plugin
+- Performance and reduced queries
+- Link has target support
+- Made the PageAttribute templatetag an 'asTag'
+- JQuery namespace fixes in admin
+
+==== 2.3.3 ====
+
+ - fixed an incompatibility with Python 2.5
+
+==== 2.4.0 ===-
+
+- CMS_LANGUAGE setting has changed
+- CMS_HIDE_UNTRANSLATED setting removed
+- CMS_LANGUAGE_FALLBACK setting removed
+- CMS_LANGUAGE_CONF setting removed
+- CMS_SITE_LANGUAGES setting removed
+- CMS_FRONTEND_LANGUAGES setting removed
+- MultilingualMiddleware has been removed
+
+
+
+
+
View
@@ -0,0 +1,199 @@
+##########################
+Contributing to django CMS
+##########################
+
+Like every open-source project, django CMS is always looking for motivated
+individuals to contribute to its source code.
+However, to ensure the highest code quality and keep the repository nice and
+tidy, everybody has to follow a few rules (nothing major, I promise :) )
+
+
+*********
+Community
+*********
+
+People interested in developing for the django CMS should join the
+`django-cms-developers`_ mailing list as well as heading over to #django-cms on
+the `freenode`_ IRC network for help and to discuss the development.
+
+You may also be interested in following `@djangocmsstatus`_ on twitter to get the
+GitHub commits as well as the hudson build reports. There is also a `@djangocms`_
+account for less technical announcements.
+
+
+*************
+In a nutshell
+*************
+
+Here's what the contribution process looks like, in a bullet-points fashion, and
+only for the stuff we host on GitHub:
+
+#. django CMS is hosted on `GitHub`_, at https://github.com/divio/django-cms
+#. The best method to contribute back is to create an account there, then fork
+ the project. You can use this fork as if it was your own project, and should
+ push your changes to it.
+#. When you feel your code is good enough for inclusion, "send us a `pull
+ request`_", by using the nice GitHub web interface.
+
+
+
+*****************
+Contributing Code
+*****************
+
+
+Getting the source code
+=======================
+
+If you're interested in developing a new feature for the CMS, it is recommended
+that you first discuss it on the `django-cms-developers`_ mailing list so as
+not to do any work that will not get merged in anyway.
+
+- Code will be reviewed and tested by at least one core developer, preferably
+ by several. Other community members are welcome to give feedback.
+- Code *must* be tested. Your pull request should include unit-tests (that cover
+ the piece of code you're submitting, obviously)
+- Documentation should reflect your changes if relevant. There is nothing worse
+ than invalid documentation.
+- Usually, if unit tests are written, pass, and your change is relevant, then
+ it'll be merged.
+
+Since we're hosted on GitHub, django CMS uses `git`_ as a version control system.
+
+The `GitHub help`_ is very well written and will get you started on using git
+and GitHub in a jiffy. It is an invaluable resource for newbies and old timers
+alike.
+
+
+Syntax and conventions
+======================
+
+We try to conform to `PEP8`_ as much as possible. A few highlights:
+
+- Indentation should be exactly 4 spaces. Not 2, not 6, not 8. **4**. Also, tabs
+ are evil.
+- We try (loosely) to keep the line length at 79 characters. Generally the rule
+ is "it should look good in a terminal-base editor" (eg vim), but we try not be
+ [Godwin's law] about it.
+
+
+Process
+=======
+
+This is how you fix a bug or add a feature:
+
+#. `fork`_ us on GitHub.
+#. Checkout your fork.
+#. Hack hack hack, test test test, commit commit commit, test again.
+#. Push to your fork.
+#. Open a pull request.
+
+
+Tests
+=====
+
+Having a wide and comprehensive library of unit-tests and integration tests is
+of exceeding importance. Contributing tests is widely regarded as a very
+prestigious contribution (you're making everybody's future work much easier by
+doing so). Good karma for you. Cookie points. Maybe even a beer if we meet in
+person :)
+
+Generally tests should be:
+
+- Unitary (as much as possible). I.E. should test as much as possible only one
+ function/method/class. That's the
+ very definition of unit tests. Integration tests are interesting too
+ obviously, but require more time to maintain since they have a higher
+ probability of breaking.
+- Short running. No hard numbers here, but if your one test doubles the time it
+ takes for everybody to run them, it's probably an indication that you're doing
+ it wrong.
+
+In a similar way to code, pull requests will be reviewed before pulling
+(obviously), and we encourage discussion via code review (everybody learns
+something this way) or IRC discussions.
+
+Running the tests
+-----------------
+
+To run the tests simply execute ``python setup.py test`` from your shell.
+
+
+**************************
+Contributing Documentation
+**************************
+
+Perhaps considered "boring" by hard-core coders, documentation is sometimes even
+more important than code! This is what brings fresh blood to a project, and
+serves as a reference for old timers. On top of this, documentation is the one
+area where less technical people can help most - you just need to write
+semi-decent English. People need to understand you. We don't care about style or
+correctness.
+
+Documentation should be:
+
+- We use `Sphinx`_/`restructuredText`_. So obviously this is the format you should
+ use :) File extensions should be .rst.
+- Written in English. We could discuss how it would bring more people to the
+ project by having a Klingon or some other translation, but that's a problem we
+ will confront once we already have good documentation in English.
+- Accessible. You should assume the reader to be moderately familiar with
+ Python and Django, but not anything else. Link to documentation of libraries
+ you use, for example, even if they are "obvious" to you (South is the first
+ example that comes to mind - it's obvious to any Django programmer, but not to
+ any newbie at all).
+ A brief description of what it does is also welcome.
+
+Pulling of documentation is pretty fast and painless. Usually somebody goes over
+your text and merges it, since there are no "breaks" and that GitHub parses rst
+files automagically it's really convenient to work with.
+
+Also, contributing to the documentation will earn you great respect from the
+core developers. You get good karma just like a test contributor, but you get
+double cookie points. Seriously. You rock.
+
+Section style
+=============
+
+We use Python documentation conventions for section marking:
+
+* ``#`` with overline, for parts
+* ``*`` with overline, for chapters
+* ``=``, for sections
+* ``-``, for subsections
+* ``^``, for subsubsections
+* ``"``, for paragraphs
+
+
+************
+Translations
+************
+
+
+For translators we have a `Transifex account
+<https://www.transifex.com/projects/p/django-cms/>`_ where you can translate
+the .po files and don't need to install git or mercurial to be able to
+contribute. All changes there will be automatically sent to the project.
+
+
+ .. raw:: html
+
+ Top translations django-cms core:<br/>
+
+ <img border="0" src="https://www.transifex.com/projects/p/django-cms/resource/core/chart/image_png"/>
+
+
+
+.. _fork: http://github.com/divio/django-cms
+.. _Sphinx: http://sphinx.pocoo.org/
+.. _PEP8: http://www.python.org/dev/peps/pep-0008/
+.. _django-cms-developers: http://groups.google.com/group/django-cms-developers
+.. _GitHub : http://www.github.com
+.. _GitHub help : http://help.github.com
+.. _freenode : http://freenode.net/
+.. _@djangocmsstatus : https://twitter.com/djangocmsstatus
+.. _@djangocms : https://twitter.com/djangocms
+.. _pull request : http://help.github.com/send-pull-requests/
+.. _git : http://git-scm.com/
+.. _restructuredText: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
+
View
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-__version__ = '2.3.1.post0'
+__version__ = '2.3.3.post0'
# patch settings
try:
View
@@ -3,6 +3,7 @@
from cms.forms.widgets import UserSelectAdminWidget
from cms.models import (Page, PagePermission, PageUser, ACCESS_PAGE,
PageUserGroup)
+from cms.utils.i18n import get_language_tuple, get_language_list
from cms.utils.mail import mail_page_user_change
from cms.utils.page import is_valid_page_slug
from cms.utils.page_resolver import get_page_from_path, is_valid_url
@@ -60,7 +61,7 @@ class PageAddForm(forms.ModelForm):
help_text=_('The default title'))
slug = forms.CharField(label=_("Slug"), widget=forms.TextInput(),
help_text=_('The part of the title that is used in the URL'))
- language = forms.ChoiceField(label=_("Language"), choices=settings.CMS_LANGUAGES,
+ language = forms.ChoiceField(label=_("Language"), choices=get_language_tuple(),
help_text=_('The current language of the content fields.'))
class Meta:
@@ -74,13 +75,7 @@ def __init__(self, *args, **kwargs):
if not self.fields['site'].initial:
self.fields['site'].initial = Site.objects.get_current().pk
site_id = self.fields['site'].initial
- languages = []
- language_mappings = dict(settings.LANGUAGES)
- if site_id in settings.CMS_SITE_LANGUAGES:
- for lang in settings.CMS_SITE_LANGUAGES[site_id]:
- languages.append((lang, language_mappings.get(lang, lang)))
- else:
- languages = settings.CMS_LANGUAGES
+ languages = get_language_tuple(site_id)
self.fields['language'].choices = languages
if not self.fields['language'].initial:
self.fields['language'].initial = get_language()
@@ -92,10 +87,7 @@ def __init__(self, *args, **kwargs):
def clean(self):
cleaned_data = self.cleaned_data
- if 'slug' in cleaned_data.keys():
- slug = cleaned_data['slug']
- else:
- slug = ""
+ slug = cleaned_data.get('slug', '')
page = self.instance
lang = cleaned_data.get('language', None)
@@ -116,14 +108,14 @@ def clean(self):
if site and not is_valid_page_slug(page, parent, lang, slug, site):
self._errors['slug'] = ErrorList([_('Another page with this slug already exists')])
del cleaned_data['slug']
- if self.cleaned_data['published'] and page.title_set.count():
+ if self.cleaned_data.get('published') and page.title_set.count():
#Check for titles attached to the page makes sense only because
#AdminFormsTests.test_clean_overwrite_url validates the form with when no page instance available
#Looks like just a theoretical corner case
title = page.get_title_obj(lang)
if title:
oldslug = title.slug
- title.slug = self.cleaned_data['slug']
+ title.slug = slug
title.save()
try:
is_valid_url(title.path,page)
@@ -142,7 +134,7 @@ def clean_slug(self):
def clean_language(self):
language = self.cleaned_data['language']
- if not language in dict(settings.CMS_LANGUAGES).keys():
+ if not language in get_language_list():
raise ValidationError("Given language does not match language settings.")
return language
Oops, something went wrong.

0 comments on commit de29468

Please sign in to comment.