Re: Can I access App Data in CMS

2020-01-17 Thread kaito .
Yes

On Sat, Jan 18, 2020, 2:48 AM Balaji Shetty  wrote:

> Hi
>
> I have to create static pages with Audio, video and image Gallery in
> existing Django Software App.
>
> How can I achieve it.
>
> Should I create CMS and access Software App Data. is it possible to use
> django App Data in CMS.
>
> Which CMS we should prefer.
>
>
> --
> Mr Shetty Balaji
> Asst. Prof.
> IT Department
> SGGS I
> Nanded. My. India
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAECSbOtASyF36xTkxs%3Dz_UgWV1V_Jfq%2BFMBrmehfM5MPBcrEwQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOgSYSD5ZYFaFTci0H2z8t9xZtWT5novtEOm_JcHEcKM2BeV5g%40mail.gmail.com.


How to use filtering data while using distinct method in django?

2020-01-16 Thread kaito
please visit this site for more 
info 
https://stackoverflow.com/questions/59764028/how-to-use-filtering-data-while-using-distinct-method-in-django

I hope my title is enough to understand what I mean, please help me on this 
problem guys.

[image: data.PNG]


When I tried this:

   "" id_list = 
grade.objects.filter(Teacher=m.id).values_list('Students_Enrollment_Records_id',flat=True).distinct()
 
""


I use `distinct()` to eliminates duplicate rows of Students Enrollment 
Record from the query results but I wonder why the result is like this:

[image: badresult.PNG]




What should I do to show the Students name not that QuerySet in my html?

This is my current **views.py**:

id_list = 
grade.objects.filter(Teacher=m.id).values_list('Students_Enrollment_Records_id',flat=True).distinct()
print(id_list)
grades = 
grade.objects.filter(Students_Enrollment_Records_id__in=id_list)
print(grades)

This is my **models.py**:

class grade(models.Model):
Teacher = models.ForeignKey(EmployeeUser, related_name='+', 
on_delete=models.CASCADE,
null=True, blank=True)
Grading_Categories = models.ForeignKey(gradingCategories, 
related_name='+', on_delete=models.CASCADE,
   null=True, blank=True)
Subjects = models.ForeignKey(Subject, related_name='+', 
on_delete=models.CASCADE, null=True)
Students_Enrollment_Records = 
models.ForeignKey(StudentsEnrolledSubject, related_name='+',

on_delete=models.CASCADE, null=True)
Average = models.FloatField(null=True, blank=True)

**UPDATE**

when I tried this 

piste = 
grade.objects.filter(Teacher_id=m.id).values_list('Students_Enrollment_Records').annotate(Average=Avg('Average')).order_by('Grading_Categories').distinct()

the computation is fix but the teacher name, Subject and Name of students 
didn't display but the ID is display just like this 

[image: result.PNG]

this is my desire answer 

[image: desireanswer.png]




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fd4ff945-0793-46e7-aae4-caae652e62ed%40googlegroups.com.