Hi!

For mi, You need 2 models:
-users
-attention


Users save the persons
Atention save one attend event

Atention, will have : -date datefield,  user foreignkey(users)


Then you can do query sets like, how many attentions has Pepito. How many
attentions has Pepito this mounth,  last days... this year.....

I recommend you a lite of reading:
https://docs.djangoproject.com/en/2.2/topics/db/models/


PD: if is more easy for you, you  can do 1 model, adding user atribute to
attention

PD2: may be if you play with django-admin, you will understand a greater
idea from Models

Thanks!






Missatge de Harold A <hyachi...@gmail.com> del dia dv., 16 d’ag. 2019 a les
3:35:

> Hello everyone, I am a beginner in Django. I would like you to guide me on
> how to solve the next problem I have.
>
>
> In my application I have fields from date01 = models.DataFiled(blank =
> True, null = True) *to* date31 = models.DataFiled(blank = True, null =
> True), This to know the number of days a person attended during the month .
> Depending on the dates saved in the fields. And show the dates you attended
> and the sum of the days during the month.
>
> Example: Juan attended 15 days, Pedro attended 20 days.
>
>
> Thanks for the help.
>
> --
> 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/a8f0411a-e289-4a39-bfb2-c87047d1b33d%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a8f0411a-e289-4a39-bfb2-c87047d1b33d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAK-JoTTj8RHxh4yGC4V87KGEam5a%2BZPY-5e9QCoGDixzXHRKKA%40mail.gmail.com.

Reply via email to