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

  • SEARCH
  • Home
  • 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 8181943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:41:35+00:00 2026-06-07T00:41:35+00:00

i have asked a question about manytomanyfield here which i solved but now a

  • 0

i have asked a question about manytomanyfield here which i solved but now a new problem is raised as,

DatabaseError at /admin/myapp/photo/8/delete/

relation "woek_gallery_photos" does not exist
LINE 1: DELETE FROM "woek_gallery_photos" WHERE "photo_id" IN ...

i know why this problem raises but i dont know how to. i have one Photo model which has relation with both Group model and Gallery model. when i add an image from Gallery it works good but as to deleting it, raises problem with Group about not having any relation…

class Gallery(models.Model):
    ....
    photos = models.ManyToManyField('Photo', related_name='galleries', 
             verbose_name=_('Gallery'),
                                    null=True, blank=True)

class Group(models.Model):
    ...
    photos = models.ManyToManyField('Photo', related_name='galleries', 
             verbose_name=_('Group'),
                                    null=True, blank=True, 
                                    through='through=GroupPhotos')

class Photo(models.Model):
    image = models.ImageField(verbose_name = "Browse", 
                              upload_to=myPath)

I appreciate your all helping.

  • 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-06-07T00:41:38+00:00Added an answer on June 7, 2026 at 12:41 am

    That error means the join table for the relationship between Photo and Gallery is missing or was never created in the first place. If you haven’t done so already run:

    python manage.py syncdb
    

    If that still doesn’t work, create the table manually. You can run:

    python manage.py sqlall yourapp
    

    to get the proper SQL to use. Look for the lines where it creates woek_gallery_photos and copy that bit. Then run:

    python manage.py dbshell
    

    And paste it at the prompt. Hit enter, and you should be good to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

okay... I have asked this question about this but there is a new thing
I have asked a question before about creating a child window here ... Now
I already asked a question about this yesterday, but now I have another :)
I have been asked to post a new question about how to correctly sort
I asked a question about bigints yesterday which was kindly answered. However, I have
I have asked this question here about a Python command that fetches a URL
As I have asked the similar question about servlet ,which is for showing a
I have already asked a question about this, but the problems keeps on hitting
Recently I have asked a question about what I should use to create self-contained
I have asked a similar question about command line arguments in C++ some hours

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.