Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
7d73ac7c22
|
@ -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):
|
||||
|
|
Binary file not shown.
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue