Explore >> Select a destination


You are here

sobolevn.me
| | rtpg.co
20.1 parsecs away

Travel
| |
| | www.paepper.com
10.1 parsecs away

Travel
| | Unit testing your models in Django As a good developer, you write unit tests, of course. You will probably even write your tests before implementing your logic in a test-driven approach! However, when developing complex models which have interactions and foreign keys, writing tests can get messy and complicated. Say you want to test a model which has many dependencies to other models via foreign keys. To create an instance of your model, you first need to create all the other model instances which your m...
| | zhd.dev
31.0 parsecs away

Travel
| |
| | vxlabs.com
84.6 parsecs away

Travel
| 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, sch...