My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 415: djangoforms renders StringListProperty incorrectly
12 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ma...@google.com
Closed:  Oct 2008


Sign in to add a comment
 
Reported by spei...@gmail.com, May 31, 2008
What steps will reproduce the problem?
Model:
class Test(db.Model):
    items = db.StringListProperty()    

View:
def test(request):  
    class TestForm(djangoforms.ModelForm):
        class Meta:
            model = Test
            
    form = TestForm()
    return render_to_response('test.html', {'form':form})

What is the expected output? What do you see instead?
According to appengine.ext.db.djangoforms ListProperties are supposed to 
rendered in a Textarea, with one value on each line.
However in my Test a Inputfield ist rendered with a value of "[]". 
Changing this value to that "['test']" results in a value of 
"[,',t,e,s,t,',]" in the data store. 

What version of the product are you using? On what operating system?
vista, 1.1.0
Jul 11, 2008
#1 spei...@gmail.com
Here's a workaround:

in ext.db.__init__, StringListProperty function (line 2144), remove it and replace with:

class StringListProperty(ListProperty):
  def __init__(self, verbose_name=None, default=None, **kwds):
      return super(StringListProperty, self).__init__(basestring, verbose_name,
default, **kwds)
Aug 19, 2008
#2 jscud.w...@gmail.com
(No comment was entered for this change.)
Status: Accepted
Owner: ma...@google.com
Oct 3, 2008
Project Member #3 ma...@google.com
(No comment was entered for this change.)
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting