/explore

Click through on any links that interest you or select the planets on the right to continue exploring the Outer Web.
You are here

jinyuz.dev
| | vxlabs.com

In order to add a GiST index on a Postgres database that could be used to accelerate trigram matches using the pg_trgm module and the special gist_trgm_ops operator, I had to code up a special Django Index Django will hopefully soon support custom index operators, but if you need the functionality right now, this example will do the trick. The special GiST index class looks like this: from django.contrib.postgres.indexes import GistIndex class GistIndexTrgrmOps(GistIndex): def create_sql(self, model, schema_editor): # - this Statement is instantiated by the _create_index_sql() # method of django.db.backends.base.schema.BaseDatabaseSchemaEditor. # using sql_create_index template from # django.db.backends.postgresql.schema.DatabaseSchemaEditor # - the template...
2.5 parsecs

Travel
| |
| | www.kencochrane.com


2.5 parsecs

Travel
| |
| | www.rasulkireev.com

Whenever you building a site with Django that will have user authentication, it is recommended to create a Custom User Model, before the first migration. Sometimes you forget to do that. In this case you have to follow a strict procedure, which I'll show you in the post.
2.3 parsecs

Travel
| |
| | rednafi.com

Sort Django querysets by custom attribute sequences using Case and When expressions for database-level ordering with SQL CASE statements.
22.9 parsecs

Travel
|