Merge remote-tracking branch 'origin/master'

This commit is contained in:
Bob 2020-10-25 22:22:35 +08:00
commit 7d73ac7c22
3 changed files with 5 additions and 1 deletions

View File

@ -50,6 +50,7 @@ class Group(models.Model):
village = models.CharField('', max_length=256, null=True, blank=True)
classify = models.CharField(
'分类', max_length=256, null=True, blank=True, choices=GROUP_CLASSIFY_CHOICES)
rank = models.IntegerField('rank', default=0)
user = models.ForeignKey(
User, on_delete=models.CASCADE, blank=True, null=True)
@ -670,6 +671,9 @@ class News(models.Model):
def __str__(self):
return self.title
class Meta:
ordering = ["-date"]
# 手机验证码验证表
class CheckCode(models.Model):

View File

@ -10,7 +10,7 @@ from polls.decorators import polls_login_required
@polls_login_required
def news_list(request):
category = request.GET.get('category', '1')
news_list = News.objects.filter(type=category)
news_list = News.objects.filter(type=category).order_by('-date')
results = []
for o in news_list:
result = dict()