Created
July 31, 2012 15:45
-
-
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:))
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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