jazzina / ltreefield

Django Field class for PostgreSQL ltree data type.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ltreefield

Django Field class for PostgreSQL ltree data type.

Class

LtreeField

Lookups

  • aore
    • ltree @> ltree
    • is left argument an ancestor of right (or equal)?
  • dore
    • ltree <@ ltree
    • is left argument a descendant of right (or equal)?
  • match
    • ltree ~ lquery
    • does ltree match lquery?

Usage

path__aore='Top.Science' # path @> 'Top.Science'
path__dore='Top.Science' # path <@ 'Top.Science'
path__match='*.Astronomy.*' # path ~ '*.Astronomy.*'

Reference

PostgreSQL: Documentation: 9.3: ltree

About

Django Field class for PostgreSQL ltree data type.

License:MIT License


Languages

Language:Python 100.0%