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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:17:37+00:00 2026-05-24T11:17:37+00:00

How to create Postgres ltree data type for Django? and how to use it

  • 0

How to create Postgres ltree data type for Django? and how to use it with QuerySets? (create wrapper? how?)

About lree here:
http://www.postgresql.org/docs/current/static/ltree.html

About custom fields in Django here:
docs.djangoproject.com/en/1.2/howto/custom-model-fields/

P.S.
Also there are “Django Tree Libraries” but ltree looks better..

  • 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-24T11:17:38+00:00Added an answer on May 24, 2026 at 11:17 am

    You have listed two of the correct pieces. The general method for adapting a PostgreSQL data type to Django is:

    1. Create a new Python class that represents the data type.
    2. Register that data type with psycopg2 so that psycopg2 understands how adapt it to the database.

    Documentation on step 2 is available at http://initd.org/psycopg/docs/advanced.html#adapting-new-types …

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

Sidebar

Related Questions

postgres has an array data type, in this case a numeric array: CREATE TABLE
I use psycopg2 for accessing my postgres database in python. My function should create
Postgres Full Text Search performance seems to depend on the dictionary you use, here's
How can I create a constraint to use a regular expression in postgres?
When I create a table in PostgreSQL, the SQL I use looks like this:
I want to create a postgres function that builds the set of columns it
I have a migration that runs an SQL script to create a new Postgres
Apparently there is a database postgres that is created by default on each postgresql
I want to create a postgres user that can access only one database on
I have a problem in postgres function: CREATE OR REPLACE FUNCTION linkedRepoObjects(id bigint) RETURNS

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.