Skip to content

Instantly share code, notes, and snippets.

@rvause
Created July 31, 2012 15:45
Show Gist options
  • Save rvause/3217953 to your computer and use it in GitHub Desktop.
Save rvause/3217953 to your computer and use it in GitHub Desktop.
model base for my Django projects (small but it might grow (or even shrink D:))
from django.db import models
class BaseModel(models.Model):
def update(self, **kw):
for k, v in kw.items():
setattr(self, k, v)
self.save()
class Meta:
abstract = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment