django - I want one choice to effect two fields in admin -
i subclassing model mezzanine, django app.
in admin, want have selection list. selection tied image fixed list of images displayed in blog post.
so, admin have nice little thumbnail next selection after choosing list.
i have looked subclassing or extending django field, above head (not totally.)
filebrowsefield
closest fit i've found.
i consider path offered. challenge , have time. i'm not looking have blog author upload image, images choices already.
again, include image in admin page.
this going require knowledge of javascript django's admin scheme , template language. core components custom admin.py custom model.py, admin widget choosing image, , template changes both end-user , admin interface. static list of images can included choices on charfield. if value of choices
key-value pair url image, can write thumbnail of template.
alternatively, create image model has foreignkey relation blog post (or vice versa, depending on goal) , utilize filebrowsefield field on image.
django subclassing mezzanine
No comments:
Post a Comment