Beispiel #1
0
class DeviceModelAdmin(BaseAdmin):
    list_display = ('name', 'image_img_tag', 'added', 'updated')
    list_display_links = ('name', 'image_img_tag')
    search_fields = ('name', )

    formfield_overrides = {
        models.ImageField: {
            'widget': AdvancedFileInput(image_width=250)
        },
    }
Beispiel #2
0
class ImageInline(BaseStackedInline):
    model = Image
    
    formfield_overrides = {
        models.ImageField: {'widget': AdvancedFileInput(image_width=250)},
    }
    
    if 'grappelli' in settings.INSTALLED_APPS:
        sortable_field_name = 'order'
        classes = ('grp-collapse grp-open', )
Beispiel #3
0
class AntennaModelAdmin(BaseAdmin):
    list_display = ('name', 'image_img_tag', 'added', 'updated')
    list_display_links = ('name', 'image_img_tag')
    search_fields = ('name', )
    inlines = [RadiationPatternInline]

    formfield_overrides = {
        models.ImageField: {
            'widget': AdvancedFileInput(image_width=250)
        },
    }
Beispiel #4
0
class ManufacturerAdmin(BaseAdmin):
    list_display = ('name', 'image_img_tag', 'url_tag', 'added', 'updated')
    list_display_links = ('name', 'image_img_tag')
    search_fields = ('name', )
    inlines = [MacPrefixInline]

    formfield_overrides = {
        models.ImageField: {
            'widget': AdvancedFileInput(image_width=250)
        },
    }
Beispiel #5
0
class StatusIconInline(admin.StackedInline):
    model = StatusIcon
    extra = 0
    
    formfield_overrides = {
        models.ImageField: {'widget': AdvancedFileInput(image_width='auto')},
    }
    
    if 'grappelli' in settings.INSTALLED_APPS:
        classes = ('grp-collapse grp-open', )
        inline_classes = ('grp-collapse grp-open',)