Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6800717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:00:15+00:00 2026-05-26T19:00:15+00:00

This is my first project in django and im using photologue for gallery, which

  • 0

This is my first project in django and im using photologue for gallery, which is awesome and i really like it.

But there is one thing i dont get, how can i use its ImageModel?

I have a blog-app and with every new blogpost created in the admin interface i woud like to upload a image which is linked to that post.

from django.db import models
from tagging.fields import TagField
from tinymce import models as tinymce_models
from photologue.models import ImageModel
#import datetime

# Create your models here.
class Blog(models.Model):
    title = models.CharField(max_length=150)
    content = tinymce_models.HTMLField()
    pub_date = models.DateTimeField(auto_now_add=True)
    edit_date = models.DateTimeField(auto_now=True)
    tags = TagField()
    summary = models.CharField(max_length=30)
    thumbnail = ImageModel()


def __unicode__(self):
    return self.title

This code above doesn’t seem to work or do anything in fact.

I have been rifling through the docs, google ect and trying to understand the photologue source myself but i cant seem to get it to work like i want to.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:00:16+00:00Added an answer on May 26, 2026 at 7:00 pm

    ImageModel is an abstract class. You can’t use it as itself. Instead, you must subclass it:

    class BlogImage(ImageModel):
        pass
    
    class Blog(models.Model):
        ...
        thumbnail = models.ForeignKey(BlogImage, related_name='blogs')
    

    But, the main purpose of ImageModel is to allow you to create a photo model with additional custom data that still behaves like one of photologue’s models. photologue already has Photo which is a real model based on ImageModel that you can use if you just need the defaults.

    class Blog(models.Model):
        ...
        thumbnail = models.ForeignKey(Photo, related_name='blogs')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a new project on django, in which im using Grappelli and filebrowser,
This is my first time doing this sort of project so apologies if the
This is the first time I'm creating an open-source project, and I've decided (based
I'm starting a new personal project on the side, so this is the first
Just recently I dove into the VideoLAN open source project. This was my first
This project is the probable first step in migrating a large CMS from Classic
Imagine this as the code from build.xml: <project name=test project> <target name=first> <echo>first</echo> </target>
Saw this piece of code in a Ruby on Rails book. This first one
problem euler #5 i found the solution but i don't know why this first
Using Dozer to map two objects, I have: /** /* This first class uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.