My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
  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
Closed:  Oct 2008

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

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
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
(No comment was entered for this change.)
Status: Accepted
Oct 3, 2008
Project Member #3
(No comment was entered for this change.)
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting