straight55b / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

setting form.cleaned_data['field'] doesn't work in admin #196

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
class Article_base(polymodel.PolyModel):
    #------
    added_by = db.StringProperty(required=True)
    changed_by = db.StringProperty(required=True)
    #------

class ArticleBaseAdmin(admin.ModelAdmin):
     exclude = ('added_by', 'changed_by']
     def save_form(self, request, form, change):
        f = form.cleaned_data
        if not change:
            f['added_by'] = request.user.username
        f['changed_by'] = request.user.username
        return form.save(commit=False)

admin.site.register(Article_base, ArticleBaseAdmin)

2. form.save() doesn't sets added_by and changed_by
3. last line(form.save) produces error:
   Property changed_by is required

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
app-engine-patch 1.1RC, ArchLinux

Please provide any additional information below.
There was no problem with previous version of aep.

Original issue reported on code.google.com by pgha...@gmail.com on 4 Aug 2009 at 7:04