JSONable model base

1
2
3
4
5
class JsonableModel(models.Model):
	class Meta:
		abstract = True
	def to_json(self):
		return render_to_string('models/%s.json' % self._meta.module_name,{'object':self})	

More like this

  1. Command to make fixtures. by buriy 4 years, 9 months ago
  2. Modeli18n by pavl 2 years, 11 months ago
  3. Deep json serialization by Alexey Boriskin 3 years, 10 months ago
  4. Using dojo/json to check for username availability by heckj 5 years, 11 months ago
  5. Url persistance of GET variables by alex_ndc 4 years, 6 months ago

Comments

(Forgotten your password?)