Django Model Template

Descripción

Django model template with timestamps and __str__ method


File Template: ✅


Prefix

dj:model


Scopes

python


Snippet de código

from django.db import models

class ${1:ModelName}(models.Model):
	${2:field_name} = models.${3:CharField}(max_length=${4:100})
	${5:another_field} = models.${6:TextField}(blank=True)
	created = models.DateTimeField(auto_now_add=True)
	updated = models.DateTimeField(auto_now=True)

	def __str__(self):
		return self.${2:field_name}