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

The Archive Base Latest Questions

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

A bit of background… I’m trying to create a custom auth backend and extend

  • 0

A bit of background…

I’m trying to create a custom auth backend and extend the user model. I’m using the following as a blue print:

blog post by Scott Barnham

For whatever reason, the ORM is generating invalid sql. It seems to want to do a inner join back to itself and it’s failing because it can’t find a field named user_ptr_id for the join.

If you do a search for this, it seems that I might not be the only one. And there is actually a reference to this in a comment on the blog post above. But, I can’t seem to fix it.

It seems like I should be able to override the SQL that is getting generated. Is that correct? From what I can tell, it seem like I might do this with a custom Object manager. Correct?

However, I can’t seem to find a good example of what I want to do. Everything that I see is wanting to inherit and chain them. That’s not really what I want to do. I sort of just want to say something like:

hey Django! on a select, use this SQL statement. etc

Is this possible? Maybe my “googlin'” is off today, but I can’t seem to find it. That leads me to believe I’m using wrong terms or something.

Please note: I’m using Django 1.3.1 with Python 2.6.5 and PostgreSQL 9.1

  • 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-28T04:52:42+00:00Added an answer on May 28, 2026 at 4:52 am

    David,

    Yes, you can override the behavior of a model by implementing an overriding Manager in the object. I found a great blog by Greg Allard on A Django Model Manager for Soft Deleting Records which runs through a soft delete, to set a field deleted to True/False and only show objects that are not deleted, or all with deleted objects.

    With that in mind, I would think you could override your object’s all(), or filter() methods to get what you want. As an aside, everytime I have used a pointer, “ptr” is evident in the name of the field, it is because of class inheritance. For example, class Animal():..., class Man(Animal): Man extends or is a subclass of Animal. In the database, the Man table will have an animal_ptr_id which “extends” the animal table’s tuple with that id as a Man with ANIMAL fields and MAN fields JOINed.

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

Sidebar

Related Questions

A bit of background first: I am using base code from a remote SVN
For a bit of background to know what i am doing: using hit highlighter
Bit of Background info, I'm using An NSOutlineView with Core Data. This Is What
As a bit of background - I'm using JBoss 5.1, for web applications. The
A bit of background: I am getting started with GPGPU (OpenCL), I am using
A bit of background: I am using asp .net MVC and I am not
I'm trying to create a database but in the design process. A bit of
First a bit of background. I have been working on the MS platform for
For a bit of background, I'm writing a meter reading application in C for
Let me start off with a bit of background. This morning one of our

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.