Cómo se pronuncia Convert date field to value 1

5 views
Skip to first unread message

Harold A

unread,
Aug 15, 2019, 9:36:02 PM8/15/19
to Django users

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.

Gil Obradors

unread,
Aug 16, 2019, 2:22:20 AM8/16/19
to django...@googlegroups.com
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.....



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 <hyac...@gmail.com> del dia dv., 16 d’ag. 2019 a les 3:35:
--
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...@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.
Reply all
Reply to author
Forward
0 new messages