From b82ad10f9d20643e8c1372210cf5c279402789cc Mon Sep 17 00:00:00 2001 From: Karen Tracey Date: Thu, 13 Aug 2009 16:59:59 +0000 Subject: Fixed #11508: Adding missing word to form wizard doc. Thanks thepointer and timo. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11444 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/contrib/formtools/form-wizard.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/ref') diff --git a/docs/ref/contrib/formtools/form-wizard.txt b/docs/ref/contrib/formtools/form-wizard.txt index c81c24242a..98f0dbad42 100644 --- a/docs/ref/contrib/formtools/form-wizard.txt +++ b/docs/ref/contrib/formtools/form-wizard.txt @@ -95,7 +95,7 @@ Creating a ``FormWizard`` class The next step is to create a :class:`~django.contrib.formtools.wizard.FormWizard` class, which should be a subclass of ``django.contrib.formtools.wizard.FormWizard``. -As your :class:`~django.forms.forms.Form` classes, this +As with your :class:`~django.forms.forms.Form` classes, this :class:`~django.contrib.formtools.wizard.FormWizard` class can live anywhere in your codebase, but convention is to put it in :file:`forms.py`. -- cgit v1.3 From dcf3be7a621f011a918453527406216a738acf68 Mon Sep 17 00:00:00 2001 From: Ian Kelly Date: Mon, 24 Aug 2009 15:45:48 +0000 Subject: Fixed #10566: Added support for cx_Oracle compiled with the WITH_UNICODE flag. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11477 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/oracle/base.py | 21 +++++++++++++++------ docs/ref/databases.txt | 4 ++++ tests/regressiontests/backends/tests.py | 7 ++++--- 3 files changed, 23 insertions(+), 9 deletions(-) (limited to 'docs/ref') diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index 80558a0a68..c4155e2c9a 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -36,6 +36,14 @@ DatabaseError = Database.DatabaseError IntegrityError = Database.IntegrityError +# Check whether cx_Oracle was compiled with the WITH_UNICODE option. This will +# also be True in Python 3.0. +if int(Database.version.split('.', 1)[0]) >= 5 and not hasattr(Database, 'UNICODE'): + convert_unicode = force_unicode +else: + convert_unicode = smart_str + + class DatabaseFeatures(BaseDatabaseFeatures): empty_fetchmany_value = () needs_datetime_string_cast = False @@ -170,10 +178,10 @@ WHEN (new.%(col_name)s IS NULL) return "RETURNING %s INTO %%s", (InsertIdVar(),) def savepoint_create_sql(self, sid): - return "SAVEPOINT " + self.quote_name(sid) + return convert_unicode("SAVEPOINT " + self.quote_name(sid)) def savepoint_rollback_sql(self, sid): - return "ROLLBACK TO SAVEPOINT " + self.quote_name(sid) + return convert_unicode("ROLLBACK TO SAVEPOINT " + self.quote_name(sid)) def sql_flush(self, style, tables, sequences): # Return a list of 'TRUNCATE x;', 'TRUNCATE y;', @@ -304,7 +312,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): def _cursor(self): cursor = None if not self._valid_connection(): - conn_string = self._connect_string() + conn_string = convert_unicode(self._connect_string()) self.connection = Database.connect(conn_string, **self.settings_dict['DATABASE_OPTIONS']) cursor = FormatStylePlaceholderCursor(self.connection) # Set oracle date to ansi date format. This only needs to execute @@ -355,7 +363,8 @@ class OracleParam(object): if hasattr(param, 'bind_parameter'): self.smart_str = param.bind_parameter(cursor) else: - self.smart_str = smart_str(param, cursor.charset, strings_only) + self.smart_str = convert_unicode(param, cursor.charset, + strings_only) if hasattr(param, 'input_size'): # If parameter has `input_size` attribute, use that. self.input_size = param.input_size @@ -423,7 +432,7 @@ class FormatStylePlaceholderCursor(object): # is being passed to SQL*Plus. if query.endswith(';') or query.endswith('/'): query = query[:-1] - query = smart_str(query, self.charset) % tuple(args) + query = convert_unicode(query % tuple(args), self.charset) self._guess_input_sizes([params]) try: return self.cursor.execute(query, self._param_generator(params)) @@ -445,7 +454,7 @@ class FormatStylePlaceholderCursor(object): # is being passed to SQL*Plus. if query.endswith(';') or query.endswith('/'): query = query[:-1] - query = smart_str(query, self.charset) % tuple(args) + query = convert_unicode(query % tuple(args), self.charset) formatted = [self._format_params(i) for i in params] self._guess_input_sizes(formatted) try: diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt index 007a7079b7..fc58dbaf47 100644 --- a/docs/ref/databases.txt +++ b/docs/ref/databases.txt @@ -476,6 +476,10 @@ version of the driver should **not** be used with Django; ``cx_Oracle`` 5.0.1 resolved this issue, so if you'd like to use a more recent ``cx_Oracle``, use version 5.0.1. +``cx_Oracle`` 5.0.1 or greater can optionally be compiled with the +``WITH_UNICODE`` environment variable. This is recommended but not +required. + .. _`Oracle Database Server`: http://www.oracle.com/ .. _`cx_Oracle`: http://cx-oracle.sourceforge.net/ diff --git a/tests/regressiontests/backends/tests.py b/tests/regressiontests/backends/tests.py index aff27369ad..628fabf04a 100644 --- a/tests/regressiontests/backends/tests.py +++ b/tests/regressiontests/backends/tests.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Unit and doctests for specific database backends. import unittest -from django.db import connection +from django.db import backend, connection from django.db.backends.signals import connection_created from django.conf import settings @@ -11,9 +11,10 @@ class Callproc(unittest.TestCase): # If the backend is Oracle, test that we can call a standard # stored procedure through our cursor wrapper. if settings.DATABASE_ENGINE == 'oracle': + convert_unicode = backend.convert_unicode cursor = connection.cursor() - cursor.callproc('DBMS_SESSION.SET_IDENTIFIER', - ['_django_testing!',]) + cursor.callproc(convert_unicode('DBMS_SESSION.SET_IDENTIFIER'), + [convert_unicode('_django_testing!'),]) return True else: return True -- cgit v1.3 From bb9cc01b132dbde2461191dbb1035eaae4885051 Mon Sep 17 00:00:00 2001 From: Karen Tracey Date: Sat, 29 Aug 2009 12:40:47 +0000 Subject: Fixed #6674: Documented a couple of widget arguments. Thanks timo. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11478 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/forms/widgets.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index 9735c8181f..e2ba0d7889 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -24,6 +24,13 @@ commonly used groups of widgets: Password input: ```` + Takes one optional argument: + + .. attribute:: PasswordInput.render_value + + Determines whether the widget will have a value filled in when the + form is re-displayed after a validation error (default is ``True``). + .. class:: HiddenInput Hidden input: ```` @@ -88,6 +95,14 @@ commonly used groups of widgets: Checkbox: ```` + Takes one optional argument: + + .. attribute:: CheckboxInput.check_test + + A callable that takes the value of the CheckBoxInput + and returns ``True`` if the checkbox should be checked for + that value. + .. class:: Select Select widget: ```` -- cgit v1.3