Changeset 4212
- Timestamp:
- 12/15/06 12:32:47 (2 years ago)
- Files:
-
- django/branches/boulder-oracle-sprint/AUTHORS (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/django/conf/global_settings.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/conf/project_template/settings.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/conf/project_template/urls.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/contrib/admin/media/js/admin/DateTimeShortcuts.js (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/django/contrib/admin/media/js/core.js (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/django/contrib/admin/templates/admin/search_form.html (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/contrib/admin/views/auth.py (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/django/contrib/admin/views/main.py (modified) (9 diffs)
- django/branches/boulder-oracle-sprint/django/contrib/admin/views/template.py (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/django/contrib/auth/forms.py (modified) (5 diffs)
- django/branches/boulder-oracle-sprint/django/contrib/auth/views.py (modified) (4 diffs)
- django/branches/boulder-oracle-sprint/django/contrib/comments/views/comments.py (modified) (5 diffs)
- django/branches/boulder-oracle-sprint/django/contrib/contenttypes/management.py (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/django/contrib/formtools (copied) (copied from django/trunk/django/contrib/formtools)
- django/branches/boulder-oracle-sprint/django/contrib/formtools/__init__.py (copied) (copied from django/trunk/django/contrib/formtools/__init__.py)
- django/branches/boulder-oracle-sprint/django/contrib/formtools/preview.py (copied) (copied from django/trunk/django/contrib/formtools/preview.py)
- django/branches/boulder-oracle-sprint/django/contrib/formtools/templates (copied) (copied from django/trunk/django/contrib/formtools/templates)
- django/branches/boulder-oracle-sprint/django/contrib/formtools/templates/formtools (copied) (copied from django/trunk/django/contrib/formtools/templates/formtools)
- django/branches/boulder-oracle-sprint/django/contrib/formtools/templates/formtools/form.html (copied) (copied from django/trunk/django/contrib/formtools/templates/formtools/form.html)
- django/branches/boulder-oracle-sprint/django/contrib/formtools/templates/formtools/preview.html (copied) (copied from django/trunk/django/contrib/formtools/templates/formtools/preview.html)
- django/branches/boulder-oracle-sprint/django/contrib/sitemaps/__init__.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/contrib/sitemaps/templates/sitemap_index.xml (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/contrib/sitemaps/templates/sitemap.xml (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/core/handlers/base.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/core/handlers/wsgi.py (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/django/core/servers/fastcgi.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/core/xheaders.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/db/models/fields/generic.py (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/django/db/models/fields/__init__.py (modified) (25 diffs)
- django/branches/boulder-oracle-sprint/django/db/models/fields/related.py (modified) (5 diffs)
- django/branches/boulder-oracle-sprint/django/db/models/manipulators.py (modified) (4 diffs)
- django/branches/boulder-oracle-sprint/django/http/__init__.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/middleware/gzip.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/newforms/fields.py (modified) (19 diffs)
- django/branches/boulder-oracle-sprint/django/newforms/forms.py (modified) (9 diffs)
- django/branches/boulder-oracle-sprint/django/newforms/__init__.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/newforms/models.py (copied) (copied from django/trunk/django/newforms/models.py)
- django/branches/boulder-oracle-sprint/django/newforms/util.py (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/django/newforms/widgets.py (modified) (11 diffs)
- django/branches/boulder-oracle-sprint/django/oldforms (copied) (copied from django/trunk/django/oldforms)
- django/branches/boulder-oracle-sprint/django/oldforms/__init__.py (copied) (copied from django/trunk/django/oldforms/__init__.py)
- django/branches/boulder-oracle-sprint/django/template/__init__.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/django/views/generic/create_update.py (modified) (3 diffs)
- django/branches/boulder-oracle-sprint/django/views/generic/list_detail.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/docs/add_ons.txt (modified) (1 diff)
- django/branches/boulder-oracle-sprint/docs/contributing.txt (modified) (4 diffs)
- django/branches/boulder-oracle-sprint/docs/forms.txt (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/docs/generic_views.txt (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/docs/newforms.txt (copied) (copied from django/trunk/docs/newforms.txt)
- django/branches/boulder-oracle-sprint/docs/sessions.txt (modified) (1 diff)
- django/branches/boulder-oracle-sprint/docs/settings.txt (modified) (2 diffs)
- django/branches/boulder-oracle-sprint/docs/sitemaps.txt (modified) (3 diffs)
- django/branches/boulder-oracle-sprint/docs/testing.txt (modified) (1 diff)
- django/branches/boulder-oracle-sprint/setup.py (modified) (1 diff)
- django/branches/boulder-oracle-sprint/tests/modeltests/model_forms (copied) (copied from django/trunk/tests/modeltests/model_forms)
- django/branches/boulder-oracle-sprint/tests/modeltests/model_forms/__init__.py (copied) (copied from django/trunk/tests/modeltests/model_forms/__init__.py)
- django/branches/boulder-oracle-sprint/tests/modeltests/model_forms/models.py (copied) (copied from django/trunk/tests/modeltests/model_forms/models.py)
- django/branches/boulder-oracle-sprint/tests/regressiontests/forms/tests.py (modified) (37 diffs)
- django/branches/boulder-oracle-sprint/tests/regressiontests/templates/tests.py (modified) (4 diffs)
- django/branches/boulder-oracle-sprint/tests/runtests.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/boulder-oracle-sprint/AUTHORS
r3963 r4212 52 52 Ned Batchelder <http://www.nedbatchelder.com/> 53 53 Shannon -jj Behrens <http://jjinux.blogspot.com/> 54 Esdras Beleza <linux@esdrasbeleza.com> 54 55 James Bennett 55 56 Paul Bissex <http://e-scribe.com/> … … 151 152 sopel 152 153 Thomas Steinacher <tom@eggdrop.ch> 154 nowell strite 153 155 Radek Švarz <http://www.svarz.cz/translate/> 154 156 Swaroop C H <http://www.swaroopch.info> django/branches/boulder-oracle-sprint/django/conf/global_settings.py
r4066 r4212 26 26 27 27 # Local time zone for this installation. All choices can be found here: 28 # http://www.postgresql.org/docs/ current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE28 # http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE 29 29 TIME_ZONE = 'America/Chicago' 30 30 django/branches/boulder-oracle-sprint/django/conf/project_template/settings.py
r3607 r4212 18 18 19 19 # Local time zone for this installation. All choices can be found here: 20 # http://www.postgresql.org/docs/ current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE20 # http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE 21 21 TIME_ZONE = 'America/Chicago' 22 22 django/branches/boulder-oracle-sprint/django/conf/project_template/urls.py
r2809 r4212 3 3 urlpatterns = patterns('', 4 4 # Example: 5 # (r'^{{ project_name }}/', include('{{ project_name }}. apps.foo.urls.foo')),5 # (r'^{{ project_name }}/', include('{{ project_name }}.foo.urls')), 6 6 7 7 # Uncomment this for admin: django/branches/boulder-oracle-sprint/django/contrib/admin/media/js/admin/DateTimeShortcuts.js
r3748 r4212 45 45 inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); 46 46 var now_link = document.createElement('a'); 47 now_link.setAttribute('href', "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinute ());");47 now_link.setAttribute('href', "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinuteSecond());"); 48 48 now_link.appendChild(document.createTextNode(gettext('Now'))); 49 49 var clock_link = document.createElement('a'); … … 81 81 time_list = quickElement('ul', clock_box, ''); 82 82 time_list.className = 'timelist'; 83 quickElement("a", quickElement("li", time_list, ""), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinute ());")84 quickElement("a", quickElement("li", time_list, ""), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '00:00 ');")85 quickElement("a", quickElement("li", time_list, ""), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '06:00 ');")86 quickElement("a", quickElement("li", time_list, ""), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '12:00 ');")83 quickElement("a", quickElement("li", time_list, ""), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinuteSecond());") 84 quickElement("a", quickElement("li", time_list, ""), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '00:00:00');") 85 quickElement("a", quickElement("li", time_list, ""), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '06:00:00');") 86 quickElement("a", quickElement("li", time_list, ""), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '12:00:00');") 87 87 88 88 cancel_p = quickElement('p', clock_box, ''); django/branches/boulder-oracle-sprint/django/contrib/admin/media/js/core.js
r3287 r4212 120 120 } 121 121 122 Date.prototype.getTwoDigitSecond = function() { 123 return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); 124 } 125 122 126 Date.prototype.getISODate = function() { 123 127 return this.getCorrectYear() + '-' + this.getTwoDigitMonth() + '-' + this.getTwoDigitDate(); … … 126 130 Date.prototype.getHourMinute = function() { 127 131 return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); 132 } 133 134 Date.prototype.getHourMinuteSecond = function() { 135 return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond(); 128 136 } 129 137 django/branches/boulder-oracle-sprint/django/contrib/admin/templates/admin/search_form.html
r3097 r4212 8 8 <input type="submit" value="{% trans 'Go' %}" /> 9 9 {% if show_result_count %} 10 <span class="small quiet">{% blocktrans count cl.result_count as counter %}1 result{% plural %}{{ counter }} results{% endblocktrans %} (<a href="? ">{% blocktrans with cl.full_result_count as full_result_count %}{{ full_result_count }} total{% endblocktrans %}</a>)</span>10 <span class="small quiet">{% blocktrans count cl.result_count as counter %}1 result{% plural %}{{ counter }} results{% endblocktrans %} (<a href="?{% if cl.is_popup %}pop=1{% endif %}">{% blocktrans with cl.full_result_count as full_result_count %}{{ full_result_count }} total{% endblocktrans %}</a>)</span> 11 11 {% endif %} 12 12 {% for pair in cl.params.items %} django/branches/boulder-oracle-sprint/django/contrib/admin/views/auth.py
r3925 r4212 3 3 from django.contrib.auth.models import User 4 4 from django.core.exceptions import PermissionDenied 5 from django import forms, template5 from django import oldforms, template 6 6 from django.shortcuts import render_to_response 7 7 from django.http import HttpResponseRedirect … … 25 25 else: 26 26 errors = new_data = {} 27 form = forms.FormWrapper(manipulator, new_data, errors)27 form = oldforms.FormWrapper(manipulator, new_data, errors) 28 28 return render_to_response('admin/auth/user/add_form.html', { 29 29 'title': _('Add user'), django/branches/boulder-oracle-sprint/django/contrib/admin/views/main.py
r3921 r4212 1 from django import forms, template1 from django import oldforms, template 2 2 from django.conf import settings 3 3 from django.contrib.admin.filterspecs import FilterSpec … … 227 227 model = models.get_model(app_label, model_name) 228 228 if model is None: 229 raise Http404 , "App %r, model %r, not found" % (app_label, model_name)229 raise Http404("App %r, model %r, not found" % (app_label, model_name)) 230 230 opts = model._meta 231 231 … … 284 284 285 285 # Populate the FormWrapper. 286 form = forms.FormWrapper(manipulator, new_data, errors)286 form = oldforms.FormWrapper(manipulator, new_data, errors) 287 287 288 288 c = template.RequestContext(request, { … … 303 303 object_id = unquote(object_id) 304 304 if model is None: 305 raise Http404 , "App %r, model %r, not found" % (app_label, model_name)305 raise Http404("App %r, model %r, not found" % (app_label, model_name)) 306 306 opts = model._meta 307 307 … … 314 314 try: 315 315 manipulator = model.ChangeManipulator(object_id) 316 except ObjectDoesNotExist:317 raise Http404 316 except model.DoesNotExist: 317 raise Http404('%s object with primary key %r does not exist' % (model_name, escape(object_id))) 318 318 319 319 if request.POST: … … 375 375 376 376 # Populate the FormWrapper. 377 form = forms.FormWrapper(manipulator, new_data, errors)377 form = oldforms.FormWrapper(manipulator, new_data, errors) 378 378 form.original = manipulator.original_object 379 379 form.order_objects = [] … … 491 491 object_id = unquote(object_id) 492 492 if model is None: 493 raise Http404 , "App %r, model %r, not found" % (app_label, model_name)493 raise Http404("App %r, model %r, not found" % (app_label, model_name)) 494 494 opts = model._meta 495 495 if not request.user.has_perm(app_label + '.' + opts.get_delete_permission()): … … 528 528 object_id = unquote(object_id) 529 529 if model is None: 530 raise Http404 , "App %r, model %r, not found" % (app_label, model_name)530 raise Http404("App %r, model %r, not found" % (app_label, model_name)) 531 531 action_list = LogEntry.objects.filter(object_id=object_id, 532 532 content_type__id__exact=ContentType.objects.get_for_model(model).id).select_related().order_by('action_time') … … 744 744 model = models.get_model(app_label, model_name) 745 745 if model is None: 746 raise Http404 , "App %r, model %r, not found" % (app_label, model_name)746 raise Http404("App %r, model %r, not found" % (app_label, model_name)) 747 747 if not request.user.has_perm(app_label + '.' + model._meta.get_change_permission()): 748 748 raise PermissionDenied django/branches/boulder-oracle-sprint/django/contrib/admin/views/template.py
r3951 r4212 1 1 from django.contrib.admin.views.decorators import staff_member_required 2 2 from django.core import validators 3 from django import template, forms3 from django import template, oldforms 4 4 from django.template import loader 5 5 from django.shortcuts import render_to_response … … 26 26 return render_to_response('admin/template_validator.html', { 27 27 'title': 'Template validator', 28 'form': forms.FormWrapper(manipulator, new_data, errors),28 'form': oldforms.FormWrapper(manipulator, new_data, errors), 29 29 }, context_instance=template.RequestContext(request)) 30 30 template_validator = staff_member_required(template_validator) 31 31 32 class TemplateValidator( forms.Manipulator):32 class TemplateValidator(oldforms.Manipulator): 33 33 def __init__(self, settings_modules): 34 34 self.settings_modules = settings_modules 35 35 site_list = Site.objects.in_bulk(settings_modules.keys()).values() 36 36 self.fields = ( 37 forms.SelectField('site', is_required=True, choices=[(s.id, s.name) for s in site_list]),38 forms.LargeTextField('template', is_required=True, rows=25, validator_list=[self.isValidTemplate]),37 oldforms.SelectField('site', is_required=True, choices=[(s.id, s.name) for s in site_list]), 38 oldforms.LargeTextField('template', is_required=True, rows=25, validator_list=[self.isValidTemplate]), 39 39 ) 40 40 django/branches/boulder-oracle-sprint/django/contrib/auth/forms.py
r3908 r4212 4 4 from django.template import Context, loader 5 5 from django.core import validators 6 from django import forms6 from django import oldforms 7 7 8 class UserCreationForm( forms.Manipulator):8 class UserCreationForm(oldforms.Manipulator): 9 9 "A form that creates a user, with no privileges, from the given username and password." 10 10 def __init__(self): 11 11 self.fields = ( 12 forms.TextField(field_name='username', length=30, maxlength=30, is_required=True,12 oldforms.TextField(field_name='username', length=30, maxlength=30, is_required=True, 13 13 validator_list=[validators.isAlphaNumeric, self.isValidUsername]), 14 forms.PasswordField(field_name='password1', length=30, maxlength=60, is_required=True),15 forms.PasswordField(field_name='password2', length=30, maxlength=60, is_required=True,14 oldforms.PasswordField(field_name='password1', length=30, maxlength=60, is_required=True), 15 oldforms.PasswordField(field_name='password2', length=30, maxlength=60, is_required=True, 16 16 validator_list=[validators.AlwaysMatchesOtherField('password1', _("The two password fields didn't match."))]), 17 17 ) … … 28 28 return User.objects.create_user(new_data['username'], '', new_data['password1']) 29 29 30 class AuthenticationForm( forms.Manipulator):30 class AuthenticationForm(oldforms.Manipulator): 31 31 """ 32 32 Base class for authenticating users. Extend this to get a form that accepts … … 42 42 self.request = request 43 43 self.fields = [ 44 forms.TextField(field_name="username", length=15, maxlength=30, is_required=True,44 oldforms.TextField(field_name="username", length=15, maxlength=30, is_required=True, 45 45 validator_list=[self.isValidUser, self.hasCookiesEnabled]), 46 forms.PasswordField(field_name="password", length=15, maxlength=30, is_required=True),46 oldforms.PasswordField(field_name="password", length=15, maxlength=30, is_required=True), 47 47 ] 48 48 self.user_cache = None … … 69 69 return self.user_cache 70 70 71 class PasswordResetForm( forms.Manipulator):71 class PasswordResetForm(oldforms.Manipulator): 72 72 "A form that lets a user request a password reset" 73 73 def __init__(self): 74 74 self.fields = ( 75 forms.EmailField(field_name="email", length=40, is_required=True,75 oldforms.EmailField(field_name="email", length=40, is_required=True, 76 76 validator_list=[self.isValidUserEmail]), 77 77 ) … … 106 106 send_mail('Password reset on %s' % site_name, t.render(Context(c)), None, [self.user_cache.email]) 107 107 108 class PasswordChangeForm( forms.Manipulator):108 class PasswordChangeForm(oldforms.Manipulator): 109 109 "A form that lets a user change his password." 110 110 def __init__(self, user): 111 111 self.user = user 112 112 self.fields = ( 113 forms.PasswordField(field_name="old_password", length=30, maxlength=30, is_required=True,113 oldforms.PasswordField(field_name="old_password", length=30, maxlength=30, is_required=True, 114 114 validator_list=[self.isValidOldPassword]), 115 forms.PasswordField(field_name="new_password1", length=30, maxlength=30, is_required=True,115 oldforms.PasswordField(field_name="new_password1", length=30, maxlength=30, is_required=True, 116 116 validator_list=[validators.AlwaysMatchesOtherField('new_password2', _("The two 'new password' fields didn't match."))]), 117 forms.PasswordField(field_name="new_password2", length=30, maxlength=30, is_required=True),117 oldforms.PasswordField(field_name="new_password2", length=30, maxlength=30, is_required=True), 118 118 ) 119 119 django/branches/boulder-oracle-sprint/django/contrib/auth/views.py
r3462 r4212 1 1 from django.contrib.auth.forms import AuthenticationForm 2 2 from django.contrib.auth.forms import PasswordResetForm, PasswordChangeForm 3 from django import forms3 from django import oldforms 4 4 from django.shortcuts import render_to_response 5 5 from django.template import RequestContext … … 27 27 request.session.set_test_cookie() 28 28 return render_to_response(template_name, { 29 'form': forms.FormWrapper(manipulator, request.POST, errors),29 'form': oldforms.FormWrapper(manipulator, request.POST, errors), 30 30 REDIRECT_FIELD_NAME: redirect_to, 31 31 'site_name': Site.objects.get_current().name, … … 63 63 form.save(email_template_name=email_template_name) 64 64 return HttpResponseRedirect('%sdone/' % request.path) 65 return render_to_response(template_name, {'form': forms.FormWrapper(form, new_data, errors)},65 return render_to_response(template_name, {'form': oldforms.FormWrapper(form, new_data, errors)}, 66 66 context_instance=RequestContext(request)) 67 67 … … 78 78 form.save(new_data) 79 79 return HttpResponseRedirect('%sdone/' % request.path) 80 return render_to_response(template_name, {'form': forms.FormWrapper(form, new_data, errors)},80 return render_to_response(template_name, {'form': oldforms.FormWrapper(form, new_data, errors)}, 81 81 context_instance=RequestContext(request)) 82 82 password_change = login_required(password_change) django/branches/boulder-oracle-sprint/django/contrib/comments/views/comments.py
r3936 r4212 1 1 from django.core import validators 2 from django import forms2 from django import oldforms 3 3 from django.core.mail import mail_admins, mail_managers 4 4 from django.http import Http404 … … 29 29 return [] 30 30 self.fields.extend([ 31 forms.LargeTextField(field_name="comment", maxlength=3000, is_required=True,31 oldforms.LargeTextField(field_name="comment", maxlength=3000, is_required=True, 32 32 validator_list=[self.hasNoProfanities]), 33 forms.RadioSelectField(field_name="rating1", choices=choices,33 oldforms.RadioSelectField(field_name="rating1", choices=choices, 34 34 is_required=ratings_required and num_rating_choices > 0, 35 35 validator_list=get_validator_list(1), 36 36 ), 37 forms.RadioSelectField(field_name="rating2", choices=choices,37 oldforms.RadioSelectField(field_name="rating2", choices=choices, 38 38 is_required=ratings_required and num_rating_choices > 1, 39 39 validator_list=get_validator_list(2), 40 40 ), 41 forms.RadioSelectField(field_name="rating3", choices=choices,41 oldforms.RadioSelectField(field_name="rating3", choices=choices, 42 42 is_required=ratings_required and num_rating_choices > 2, 43 43 validator_list=get_validator_list(3), 44 44 ), 45 forms.RadioSelectField(field_name="rating4", choices=choices,45 oldforms.RadioSelectField(field_name="rating4", choices=choices, 46 46 is_required=ratings_required and num_rating_choices > 3, 47 47 validator_list=get_validator_list(4), 48 48 ), 49 forms.RadioSelectField(field_name="rating5", choices=choices,49 oldforms.RadioSelectField(field_name="rating5", choices=choices, 50 50 is_required=ratings_required and num_rating_choices > 4, 51 51 validator_list=get_validator_list(5), 52 52 ), 53 forms.RadioSelectField(field_name="rating6", choices=choices,53 oldforms.RadioSelectField(field_name="rating6", choices=choices, 54 54 is_required=ratings_required and num_rating_choices > 5, 55 55 validator_list=get_validator_list(6), 56 56 ), 57 forms.RadioSelectField(field_name="rating7", choices=choices,57 oldforms.RadioSelectField(field_name="rating7", choices=choices, 58 58 is_required=ratings_required and num_rating_choices > 6, 59 59 validator_list=get_validator_list(7), 60 60 ), 61 forms.RadioSelectField(field_name="rating8", choices=choices,61 oldforms.RadioSelectField(field_name="rating8", choices=choices, 62 62 is_required=ratings_required and num_rating_choices > 7, 63 63 validator_list=get_validator_list(8), … … 118 118 return c 119 119 120 class PublicFreeCommentManipulator( forms.Manipulator):120 class PublicFreeCommentManipulator(oldforms.Manipulator): 121 121 "Manipulator that handles public free (unregistered) comments" 122 122 def __init__(self): 123 123 self.fields = ( 124 forms.TextField(field_name="person_name", maxlength=50, is_required=True,124 oldforms.TextField(field_name="person_name", maxlength=50, is_required=True, 125 125 validator_list=[self.hasNoProfanities]), 126 forms.LargeTextField(field_name="comment", maxlength=3000, is_required=True,126 oldforms.LargeTextField(field_name="comment", maxlength=3000, is_required=True, 127 127 validator_list=[self.hasNoProfanities]), 128 128 ) … … 222 222 login(request, manipulator.get_user()) 223 223 if errors or request.POST.has_key('preview'): 224 class CommentFormWrapper( forms.FormWrapper):224 class CommentFormWrapper(oldforms.FormWrapper): 225 225 def __init__(self, manipulator, new_data, errors, rating_choices): 226 forms.FormWrapper.__init__(self, manipulator, new_data, errors)226 oldforms.FormWrapper.__init__(self, manipulator, new_data, errors) 227 227 self.rating_choices = rating_choices 228 228 def ratings(self): … … 303 303 return render_to_response('comments/free_preview.html', { 304 304 'comment': comment, 305 'comment_form': forms.FormWrapper(manipulator, new_data, errors),305 'comment_form': oldforms.FormWrapper(manipulator, new_data, errors), 306 306 'options': options, 307 307 'target': target, django/branches/boulder-oracle-sprint/django/contrib/contenttypes/management.py
r3660 r4212 4 4 5 5 from django.dispatch import dispatcher 6 from django.db.models import get_ models, signals6 from django.db.models import get_apps, get_models, signals 7 7 8 def create_contenttypes(app, created_models, verbosity ):8 def create_contenttypes(app, created_models, verbosity=2): 9 9 from django.contrib.contenttypes.models import ContentType 10 10 app_models = get_models(app) … … 23 23 print "Adding content type '%s | %s'" % (ct.app_label, ct.model) 24 24 25 def create_all_contenttypes(verbosity=2): 26 for app in get_apps(): 27 create_contenttypes(app, None, verbosity) 28 25 29 dispatcher.connect(create_contenttypes, signal=signals.post_syncdb) 30 31 if __name__ == "__main__": 32 create_all_contenttypes() django/branches/boulder-oracle-sprint/django/contrib/sitemaps/__init__.py
r3710 r4212 30 30 from django.contrib.sites.models import Site 31 31 current_site = Site.objects.get_current() 32 url = "%s%s" % (current_site.domain, sitemap )32 url = "%s%s" % (current_site.domain, sitemap_url) 33 33 params = urllib.urlencode({'sitemap':url}) 34 34 urllib.urlopen("%s?%s" % (ping_url, params)) django/branches/boulder-oracle-sprint/django/contrib/sitemaps/templates/sitemap_index.xml
r3869 r4212 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <sitemapindex xmlns="http://www. google.com/schemas/sitemap/0.84">2 <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> 3 3 {% for location in sitemaps %}<sitemap><loc>{{ location|escape }}</loc></sitemap>{% endfor %} 4 4 </sitemapindex> django/branches/boulder-oracle-sprint/django/contrib/sitemaps/templates/sitemap.xml
r3869 r4212 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <urlset xmlns="http://www. google.com/schemas/sitemap/0.84">2 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> 3 3 {% spaceless %} 4 4 {% for url in urlset %} django/branches/boulder-oracle-sprint/django/core/handlers/base.py
r3951 r4212 85 85 # Complain if the view returned None (a common error). 86 86 if response is None: 87 raise ValueError, "The view %s.%s didn't return an HttpResponse object." % (callback.__module__, callback.func_name) 87 try: 88 view_name = callback.func_name # If it's a function 89 except AttributeError: 90 view_name = callback.__class__.__name__ + '.__call__' # If it's a class 91 raise ValueError, "The view %s.%s didn't return an HttpResponse object." % (callback.__module__, view_name) 88 92 89 93 return response django/branches/boulder-oracle-sprint/django/core/handlers/wsgi.py
r3877 r4212 63 63 """ 64 64 if not size: 65 return copyfileobj(fsrc, fdst, length)65 return 66 66 while size > 0: 67 67 buf = fsrc.read(min(length, size)) … … 158 158 except AttributeError: 159 159 buf = StringIO() 160 content_length = int(self.environ['CONTENT_LENGTH']) 160 try: 161 # CONTENT_LENGTH might be absent if POST doesn't have content at all (lighttpd) 162 content_length = int(self.environ.get('CONTENT_LENGTH', 0)) 163 except ValueError: # if CONTENT_LENGTH was empty string or not an integer 164 content_length = 0 161 165 safe_copyfileobj(self.environ['wsgi.input'], buf, size=content_length) 162 166 self._raw_post_data = buf.getvalue() django/branches/boulder-oracle-sprint/django/core/servers/fastcgi.py
r4066 r4212 119 119 return fastcgi_help("ERROR: Implementation must be one of prefork or thread.") 120 120 121 wsgi_opts['debug'] = False # Turn off flup tracebacks 122 121 123 # Prep up and go 122 124 from django.core.handlers.wsgi import WSGIHandler django/branches/boulder-oracle-sprint/django/core/xheaders.py
r3786 r4212 18 18 """ 19 19 from django.conf import settings 20 if request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or ( request.user.is_authenticated() and request.user.is_staff):20 if request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or (hasattr(request, 'user') and request.user.is_authenticated() and request.user.is_staff): 21 21 response['X-Object-Type'] = "%s.%s" % (model._meta.app_label, model._meta.object_name.lower()) 22 22 response['X-Object-Id'] = str(object_id) django/branches/boulder-oracle-sprint/django/db/models/fields/generic.py
r3787 r4212 3 3 """ 4 4 5 from django import forms5 from django import oldforms 6 6 from django.core.exceptions import ObjectDoesNotExist 7 7 from django.db import backend … … 99 99 def get_manipulator_field_objs(self): 100 100 choices = self.get_choices_default() 101 return [curry( forms.SelectMultipleField, size=min(max(len(choices), 5), 15), choices=choices)]101 return [curry(oldforms.SelectMultipleField, size=min(max(len(choices), 5), 15), choices=choices)] 102 102 103 103 def get_choices_default(self): django/branches/boulder-oracle-sprint/django/db/models/fields/__init__.py
r4066 r4212 3 3 from django.conf import settings 4 4 from django.core import validators 5 from django import forms5 from django import oldforms 6 6 from django.core.exceptions import ObjectDoesNotExist 7 7 from django.utils.functional import curry … … 211 211 if self.choices: 212 212 if self.radio_admin: 213 field_objs = [ forms.RadioSelectField]213 field_objs = [oldforms.RadioSelectField] 214 214 params['ul_class'] = get_ul_class(self.radio_admin) 215 215 else: 216 field_objs = [ forms.SelectField]216 field_objs = [oldforms.SelectField] 217 217 218 218 params['choices'] = self.get_choices_default() … … 223 223 def get_manipulator_fields(self, opts, manipulator, change, name_prefix='', rel=False, follow=True): 224 224 """ 225 Returns a list of forms.FormField instances for this field. It225 Returns a list of oldforms.FormField instances for this field. It 226 226 calculates the choices at runtime, not at compile time. 227 227 … … 338 338 choices = property(_get_choices) 339 339 340 def formfield(self): 341 "Returns a django.newforms.Field instance for this database Field." 342 from django.newforms import CharField 343 # TODO: This is just a temporary default during development. 344 return CharField(label=capfirst(self.verbose_name)) 345 340 346 class AutoField(Field): 341 347 empty_strings_allowed = False … … 359 365 360 366 def get_manipulator_field_objs(self): 361 return [ forms.HiddenField]367 return [oldforms.HiddenField] 362 368 363 369 def get_manipulator_new_data(self, new_data, rel=False): … … 386 392 387 393 def get_manipulator_field_objs(self): 388 return [ forms.CheckboxField]394 return [oldforms.CheckboxField] 389 395 390 396 class CharField(Field): 391 397 def get_manipulator_field_objs(self): 392 return [ forms.TextField]398 return [oldforms.TextField] 393 399 394 400 def to_python(self, value): … … 405 411 class CommaSeparatedIntegerField(CharField): 406 412 def get_manipulator_field_objs(self): 407 return [ forms.CommaSeparatedIntegerField]413 return [oldforms.CommaSeparatedIntegerField] 408 414 409 415 class DateField(Field): … … 473 479 474 480 def get_manipulator_field_objs(self): 475 return [ forms.DateField]481 return [oldforms.DateField] 476 482 477 483 def flatten_data(self, follow, obj = None): … … 498 504 def get_db_prep_save(s
