Login

Snippets by hakejam

Snippet List

Generic Model

In this type of model you are allowed to define a model with a generic type. For instance, a location can be an address, GPS coordinates, an intersection and many others types. Using a many to many field, models can have multiple locations without worrying about the type of location referencing. New locations types can be added without changing the references in other models. This code is also used in Django's built in ContentTypes app.

  • models
  • generic
Read More

hakejam has posted 1 snippet.