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 7071481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:41:35+00:00 2026-05-28T05:41:35+00:00

I am developing a course registration site in Django, and I want to allow

  • 0

I am developing a course registration site in Django, and I want to allow for lazy deletion of objects; when an object is deleted, it is merely marked as deleted, but not really taken out of the database.

I am adding a new boolean property in user profiles called “deleted.” Subsequently, I want to override a Model’s get/all/filter function(s) to exclude deleted objects when retrieving sets of data.

How do I override the default get function(s)? Thank you.

  • 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-28T05:41:35+00:00Added an answer on May 28, 2026 at 5:41 am

    Override get_query_set for your model manager

    https://docs.djangoproject.com/en/dev/topics/db/managers/#modifying-initial-manager-querysets

    class MyManager(models.Manager):
        def get_query_set(self):
            return super(MyManager, self).get_query_set().exclude(deleted=True)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario I have a site where users can register for a course, I'm developing
Im developing asp.net c# web site where i want to make user authentication. without
I am developing a course registration website. A user can enroll in a class,
I'm developing a platform for developing desktop apps with web technologies. In the course
I'm currently developing an application to allow students to manage their courses, and I
Developing a project in Django with my IDE setup as Eclipse with PyDev. The
I am developing a system which is 100% ajax, except of course, the first
I'm currently developing a registration system prototype. It's very simplistic and essentially is just
I have test database and a production database. When developing I of course work
Of course and I know that JPanel doesn't exists in Android, but when I

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.