Created
May 28, 2017 03:42
-
-
Save mburke05/ded0f3dc56d3b37226426b6b39c1636b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from django import forms | |
from .models import Vendor, Vendor_Feature | |
#uploading an image form, o clue if this area is right | |
#----- | |
class UploadImageForm(forms.UploadImage): | |
logo_form = forms.ImageField() | |
#overwriting save method of image form | |
def save(self, commit=True): | |
m = super(UploadImageForm).save(commit=False) | |
# what do i do here? | |
# ------ | |
# Register your models here. | |
class VFeatureInLine(admin.StackedInline): | |
model = Vendor_Feature | |
extra = 1 | |
class VendorAdmin(admin.ModelAdmin): | |
inlines = [VFeatureInLine] | |
exclude = ('logo',) | |
admin.site.register(Vendor, VendorAdmin, UploadImage) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment