Skip to content

Instantly share code, notes, and snippets.

@alimp5
Forked from chelseatroy/models.py
Created March 18, 2021 04:45
Show Gist options
  • Save alimp5/f1760cf34ec235d226e146cbd42ced44 to your computer and use it in GitHub Desktop.
Save alimp5/f1760cf34ec235d226e146cbd42ced44 to your computer and use it in GitHub Desktop.
Example of Proxy Model Visualization
from django.db import models
class Visualization(models.Model):
name = models.CharField(primary_key=True, max_length=200)
description = models.TextField()
position = models.IntegerField(default=200)
def __repr__ (self):
return self.name
def __str__ (self):
return self.name
def from_data(csvfile):
raise NotImplementedError("You must implement from_data in your visualization subclass.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment