mirror of https://github.com/django/django.git
Refs #4960 -- Fixed selenium test failures for CharField strip changes.
This commit is contained in:
parent
8556978078
commit
e7c6a2cf9f
|
@ -15,6 +15,7 @@ from django.contrib.auth.models import Group, User
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
from django.core.files.storage import FileSystemStorage
|
from django.core.files.storage import FileSystemStorage
|
||||||
from django.core.mail import EmailMessage
|
from django.core.mail import EmailMessage
|
||||||
|
from django.db import models
|
||||||
from django.forms.models import BaseModelFormSet
|
from django.forms.models import BaseModelFormSet
|
||||||
from django.http import HttpResponse, StreamingHttpResponse
|
from django.http import HttpResponse, StreamingHttpResponse
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
@ -654,6 +655,7 @@ class RelatedPrepopulatedInline1(admin.StackedInline):
|
||||||
'fields': (('pubdate', 'status'), ('name', 'slug1', 'slug2',),)
|
'fields': (('pubdate', 'status'), ('name', 'slug1', 'slug2',),)
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
formfield_overrides = {models.CharField: {'strip': False}}
|
||||||
model = RelatedPrepopulated
|
model = RelatedPrepopulated
|
||||||
extra = 1
|
extra = 1
|
||||||
prepopulated_fields = {'slug1': ['name', 'pubdate'],
|
prepopulated_fields = {'slug1': ['name', 'pubdate'],
|
||||||
|
@ -674,6 +676,7 @@ class MainPrepopulatedAdmin(admin.ModelAdmin):
|
||||||
'fields': (('pubdate', 'status'), ('name', 'slug1', 'slug2',),)
|
'fields': (('pubdate', 'status'), ('name', 'slug1', 'slug2',),)
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
formfield_overrides = {models.CharField: {'strip': False}}
|
||||||
prepopulated_fields = {'slug1': ['name', 'pubdate'],
|
prepopulated_fields = {'slug1': ['name', 'pubdate'],
|
||||||
'slug2': ['status', 'name']}
|
'slug2': ['status', 'name']}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,18 @@
|
||||||
|
from django import forms
|
||||||
from django.views.generic.edit import UpdateView
|
from django.views.generic.edit import UpdateView
|
||||||
|
|
||||||
from .models import Article
|
from .models import Article
|
||||||
|
|
||||||
|
|
||||||
|
class ArticleForm(forms.ModelForm):
|
||||||
|
content = forms.CharField(strip=False, widget=forms.Textarea)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Article
|
||||||
|
fields = '__all__'
|
||||||
|
|
||||||
|
|
||||||
class ArticleFormView(UpdateView):
|
class ArticleFormView(UpdateView):
|
||||||
model = Article
|
model = Article
|
||||||
success_url = '/'
|
success_url = '/'
|
||||||
fields = '__all__'
|
form_class = ArticleForm
|
||||||
|
|
Loading…
Reference in New Issue