straight55b / app-engine-patch

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

admin.ModelAdmin.list_filter property doesn't work when the application is deployed #198

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create the following models:
on model.py:

class Album(db.Model):
  name = db.StringProperty()

class Picture(db.Model):
  image_data = db.BlobProperty()
  album = db.ReferenceProperty(Album, required=True)

on admin.py:

class PictureAdmin(admin.ModelAdmin):
  list_filter = ('album', )
admin.site.register(Picture, PictureAdmin)

2. Create some pictures and at least 2 albums

3. Go in the admin page /admin/myapp/picture/

What is the expected output? What do you see instead?
Now if you try to filter pictures by album it will work on the development
sdk but it wont work on the deployment server.

What version of the product are you using? On what operating system?
App Engine Patch 1.1RC, App Engine Launcher 1.2.3, Leopard

Please provide any additional information below.
NeedIndexError at /admin/myapp/picture/

Original issue reported on code.google.com by paolo.mo...@gmail.com on 5 Aug 2009 at 7:27

Attachments:

GoogleCodeExporter commented 9 years ago
try defining your list_filter differently. My filters work fine,

class CategoryAdmin(admin.ModelAdmin):
    list_display = ('name', 'long_name', 'network', 'area', 'type')
    list_filter  = [ 'network', 'area' ]
    search_fields = ['name', 'long_name', 'descr']

Original comment by tkee...@gmail.com on 9 Aug 2009 at 7:34

GoogleCodeExporter commented 9 years ago
I see the same issue. My admin.py says:

class PlaceAdmin(admin.ModelAdmin):
    fields = ['name', 'city', 'state',]
    list_filter = ['city',]

But when viewing the admin interface, the only option under "By city" is "All" 
even 
though there are multiple cities in the data.

Original comment by piet.nie...@gmail.com on 15 Nov 2009 at 4:16