add message
This commit is contained in:
parent
0150bf4f8d
commit
8116692491
|
@ -98,6 +98,9 @@ class Task(models.Model):
|
|||
def record(self):
|
||||
return TaskRecord.objects.filter(task=self).count()
|
||||
|
||||
def records(self):
|
||||
return TaskRecord.objects.filter(task=self)
|
||||
|
||||
def add_task_message(self, user_id):
|
||||
for group in self.groups.all():
|
||||
Message.objects.create(
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -16,7 +16,7 @@ def notices(request):
|
|||
if request.method == 'POST':
|
||||
return HttpResponse(status=405)
|
||||
id = request.user.id
|
||||
notices = Notice.objects.filter(user__id=id, is_read=False)
|
||||
notices = Notice.objects.filter(user__id=id)
|
||||
results = []
|
||||
for o in notices:
|
||||
result = dict()
|
||||
|
|
|
@ -88,6 +88,12 @@ def get_task(request):
|
|||
result['content'] = task.content
|
||||
result['total'] = task.total()
|
||||
result['record'] = task.record()
|
||||
# records = task.records()
|
||||
# n = []
|
||||
# for r in records:
|
||||
# p = dict()
|
||||
# profile = r.user.profile
|
||||
# print(profile)
|
||||
result['added'] = task.added.strftime("%Y-%m-%d %H:%M:%S")
|
||||
return JsonResponse({'status': 'success', 'message': result})
|
||||
|
||||
|
|
Loading…
Reference in New Issue