PageRenderTime 35ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/regressiontests/model_permalink/models.py

https://code.google.com/p/mango-py/
Python | 10 lines | 8 code | 2 blank | 0 comment | 0 complexity | 228902f9ba71e0248e5ae477e26ee4e5 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. from django.db import models
  2. class Guitarist(models.Model):
  3. name = models.CharField(max_length=50)
  4. slug = models.CharField(max_length=50)
  5. @models.permalink
  6. def url(self):
  7. "Returns the URL for this guitarist."
  8. return ('guitarist_detail', [self.slug])