Hi,

I'm trying to use InlineModelAdmins, but get a strange error thrown...

Here's admin.py:

from mysite.showroom.models import Project, ProjectImage, Client,  
Service
from django.contrib import admin
from filebrowser import fb_settings

class ProjectImageInline(admin.TabularInline):
     model = ProjectImage
     class Media:
             js = [fb_settings.URL_FILEBROWSER_MEDIA + '/js/ 
AddFileBrowser.js']

class ProjectAdmin(admin.ModelAdmin):
     inlines = [ProjectImageInline,]
     prepopulated_fields = {'slug': ('title',)}
     class Media:
             js = [fb_settings.URL_FILEBROWSER_MEDIA + '/js/ 
AddFileBrowser.js']

class ClientAdmin(admin.ModelAdmin):
     prepopulated_fields = {'slug': ('name',)}
     class Media:
             js = [fb_settings.URL_FILEBROWSER_MEDIA + '/js/ 
AddFileBrowser.js']

class ServiceAdmin(admin.ModelAdmin):
     pass

admin.site.register(ProjectImage, ProjectImageInline)
admin.site.register(Project, ProjectAdmin)
admin.site.register(Client, ClientAdmin)
admin.site.register(Service, ServiceAdmin)

The error says

type object 'ProjectImageInline' has no attribute 'date_hierarchy'

What is this about a 'date hirarchy'?

The model ProjectImage has not date:

class ProjectImage(models.Model):
     """One or more images for the project model"""
     title = models.CharField(max_length=100, help_text='The title is  
also used as the alt tag of the image.')
     image = FileBrowseField(max_length=250,
                             initial_directory='/showroom/projects/',
                             extensions_allowed=['.jpg', '.jpeg',  
'.gif', '.png', '.tif', '.tiff'])

     def __unicode__(self):
         return self.title

What could be wrong here?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to