from django.db import models
class Article(models.Model):
title=models.CharField(max_length=32,default='Title')
content=models.TextField(null=True)
def __str__(self):
return self.title
class Article(models.Model):
title=models.CharField(max_length=32,default='Title')
content=models.TextField(null=True)
def __str__(self):
return self.title
我defaultj后面的0加引号,再次打开的话会报错,不加引号正常
value="{{ article.id | default:0 }}"
value="{{ article.id | default:0 }}"
2018-07-30