django new instance of model code example
Example 1: django objects.create()
SomeModel.objects.create(firstname='ricky', lastname='ticky')
Example 2: get_absolute_url django
def get_absolute_url(self):
from django.core.urlresolvers import reverse
return reverse('', kwargs={'pk': self.pk})