Permission for admin to add patient

85 views
Skip to first unread message

Karel Curtis

unread,
Dec 11, 2022, 6:19:26 PM12/11/22
to django...@googlegroups.com
Hello to all. Please, I would like to know in Django, how to allow an administrator to add a patient, but not a simple connected user? the following pics are my models.py, view.py and my template.py.
Ajout de patient 2 view.png
template ajout de patient.png
Model patient.png

Manjusha

unread,
Dec 13, 2022, 2:01:17 AM12/13/22
to Django users
Hi, need to register the model.py file in admin.py file and then make migrations as like mention in following documentation.

Manjusha

unread,
Dec 13, 2022, 2:04:03 AM12/13/22
to Django users
I'm junior may it will work!!

rahul sharma

unread,
Dec 13, 2022, 2:07:53 AM12/13/22
to django...@googlegroups.com
connect with me in zoom

--
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/4ce231dd-8fb3-474a-b359-7a549837e07bn%40googlegroups.com.

André Hangalo

unread,
Dec 13, 2022, 2:10:04 AM12/13/22
to django...@googlegroups.com
from .models import ModelName

admin.site.register(ModelName) 

--
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/4ce231dd-8fb3-474a-b359-7a549837e07bn%40googlegroups.com.
--
RICK DEU

Abdur Rahim

unread,
Dec 13, 2022, 8:02:28 AM12/13/22
to Django users
Are you want to register your model on admin?

sere kaba

unread,
Dec 17, 2022, 6:59:15 PM12/17/22
to Django users
from .model import Patient
admin.site.register(Patient)
or 
@admin.register(Patient)

Karel Curtis

unread,
Dec 26, 2022, 12:10:04 PM12/26/22
to django...@googlegroups.com
Thank you for helping.

--
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.
Reply all
Reply to author
Forward
0 new messages