https://docs.djangoproject.com/en/5.0/ref/applications/#django.apps.AppConfig.get_models
gets you an iterable of all models loaded
On Tuesday, February 27, 2024 at 8:53:32 AM UTC-5 Alex Guetsche wrote:
> I have an application which contains more than one Model, all descended
> from an ab
I have an application which contains more than one Model, all descended
from an abstract one. All the operational Models have created and modified
fields
with datetime timestamps. [How] can I get the Django ORM to bring me the
last modified timestamp that will be the maximum of all createds
; from django.contrib.auth.models import AbstractUser
> from django.db import models
>
> class School(models.Model):
> # Your School model fields
>
> class SchoolUser(AbstractUser):
> school = models.ForeignKey(School, on_delete=models.CASCADE)
> # Add
# models.py
from django.contrib.auth.models import AbstractUser
from django.db import models
class School(models.Model):
# Your School model fields
class SchoolUser(AbstractUser):
school = models.ForeignKey(School, on_delete=models.CASCADE)
# Add other custom fields as needed
I am taking it that there is more than one "school"? If so, surely
it's is just a many-to-many relationship.
On 27 Nov 2023, at 09:33, Okkert Joubert wrote:
Good morning all,
I made a custom user model for a school, it is currently working
with djoser authentication, now what I want to
Good morning all,
I made a custom user model for a school, it is currently working with
djoser authentication, now what I want to add is for the school to add
users, so my School model is a foreignkey in SchoolUser is this possible
firstly and secondly can I add the djoser authentication to
Here I am creating django dynamic models but for getting data i am using
get method but i am not getting data it just says that table does not exist
even if it is present.
from django.http import JsonResponse
from.serializers import CreateTableSerializer
from django.db import connection
One way could be latest_action=ActionGame.obje
cts.filter(published=published).order_by('-id')[:1]
El jue, 2 mar 2023 a las 17:29, Sandip Bhattacharya (<
sand...@showmethesource.org>) escribió:
> Your problem is still about where the 'published’ value is coming from in
> the call to
Your problem is still about where the 'published’ value is coming from in the
call to filter(published=published).
Is it coming from a form? A Get parameter? A post parameter? Extract it
appropriately before calling filter()
> On Mar 2, 2023, at 3:46 AM, Byansi Samuel wrote:
>
> def action
Hey thanks, but l tried to use ordering=('-published')
On Feb 28, 2023 5:04 PM, "Dev Femi Badmus" wrote:
all_action=ActionGame.objects.all()
my_action = []
for action in all_action:
my_action.append(action)
last_action = my_action[-1]
On Tue, Feb 28, 2023 at 1:05 PM Andréas Kühne
wrote:
I'm sorry Dev, but that is really bad practice.
You are doing in python what can be done by the database. That type of code
would create a memory error and be very slow to run. It's much better to
get the last item from the database. In your example it would just be:
last_action =
all_action=ActionGame.objects.all()
my_action = []
for action in all_action:
my_action.append(action)
last_action = my_action[-1]
On Tue, Feb 28, 2023 at 1:05 PM Andréas Kühne
wrote:
> Se comments below.
>
>
> Den fre 24 feb. 2023 kl 12:14 skrev Byansi Samuel <
> samuelbyans...@gmail.com>:
Se comments below.
Den fre 24 feb. 2023 kl 12:14 skrev Byansi Samuel :
> Hey everyone, l got a problem. Am trying to retrieve a single latest
> object added everytime, and display it in the template.
> Below is my codes but;
>
> Help me figure it out the source of the problem in these different
Hey everyone, l got a problem. Am trying to retrieve a single latest object
added everytime, and display it in the template.
Below is my codes but;
Help me figure it out the source of the problem in these different
instances below
___ issue number 1___
I tried to put this code to deactivate the sensitivity of the characters
when logging in, but it does not work. What is the problem with it? It
still appears to me. Please consider the sensitivity of the characters
I want to use this method. I do not want to use the backend method Please
How to set uploaded imagefield image size both in forms or models
--
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...@google
Hi;
There's a method you're supposed to override in your views (inherit from
Views) to do what you want, it's called "get_context_data". This method
will pump whatever data you send to it into your template tags.
On Sunday, November 6, 2022 at 4:15:35 AM UTC-7 rani...@gmail.com wrote:
> my
I want to get region_name field values in my template.its .giving null value
On Sunday, November 6, 2022 at 8:31:42 PM UTC+5:30 sebasti...@gmail.com
wrote:
> Pls write us your aim with this code...
>
> Kala Rani schrieb am So., 6. Nov. 2022, 12:15:
>
>> my models.py
>>
>> class
Pls write us your aim with this code...
Kala Rani schrieb am So., 6. Nov. 2022, 12:15:
> my models.py
>
> class Locations(models.Model):
> region = models.ForeignKey(Regions,
> on_delete=models.CASCADE,blank=True,null=True)
> name = models.CharField(max_length=255)
> active_flag =
my models.py
class Locations(models.Model):
region = models.ForeignKey(Regions,
on_delete=models.CASCADE,blank=True,null=True)
name = models.CharField(max_length=255)
active_flag = models.BooleanField(default=True)
created_at = models.DateTimeField(auto_now_add = True)
updated_at =
Hey everyone,
I need a help, regarding use of proxy models at foreignKey field.
class User(AbstractUser):
is_customer = models.BooleanField(default=False)
...
class Customer(User):
objects = CustomerManger() # get_queryset will filtered out all the
models based
You can use js datatable to render csv or what ever you want in the table
format. You can also upload data as csv in file upload in model form. If
you want to render csv, then it should transform to json format and pass
via jsonresponse. Or httepresponse using mimetype.
On Fri, 23 Sep, 2022, 7:20
do a file upload, then have separate code which
reads the file into models. Separating these things helps with managing “sets”
of data and catching malformed files.
For fancy plots I use Bokeh which, if you don’t need realtime updates, can be
run from within Django.
For models, you should
Hello All,
I am new to Django and currently in the mid of a project. I am creating a
dashboard for a hospital and the data is in the form of a csv/xls. I have
rendered the the interactive graphs which I need to display on the
dashboard, however on the jupyter notebook. How can I integrate it
Hi,
Some blogs I have written,
hope someone find it useful :)
https://jishnuck.medium.com/customizing-django-models-to-facilitate-user-restricted-data-768fe8206f82
<https://jishnuck.medium.com/customizing-django-models-to-facilitate-user-restricted-data-768fe8206f82>
Jishnu C K
j
with the new version of django
> by adding apps and import modules.
>
> On Sat, 27 Aug 2022, 23:55 Lakshyaraj Dash,
> wrote:
>
>> Ya sure you can use the same models throughout your project. If you're i
>> a different app then import statement will be like
>>
Am new in django framework, am get problem with the new version of django
by adding apps and import modules.
On Sat, 27 Aug 2022, 23:55 Lakshyaraj Dash,
wrote:
> Ya sure you can use the same models throughout your project. If you're i a
> different app then import statement will be like
Ya sure you can use the same models throughout your project. If you're i a
different app then import statement will be like
from appName.models import tableName
else if you're in the same app
from .models import tableName
Thanks and Regards
Lakshyaraj Dash
On Sun, Aug 28, 2022, 04:48 Javier L
You can use a model from one app in other apps. Simply import it in the apps
where you need it.
On August 27, 2022 5:43:40 PM CDT, "Javier L. Camacaro"
wrote:
>Do i need to repeat the models for each app?, Can I use same model for all
>the apps in my project?
>
&g
Do i need to repeat the models for each app?, Can I use same model for all
the apps in my project?
I'm a new a DJango programmer, sorry for that
Thanks!
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this grou
Hi All,
I'm working on an API-server project that uses dynamically generated Django
models, so it can service many user-provided datasets. To ease maintenance
work, we'd like to generate the SQL statements to migrate database tables
to a newer version of the schema. I've managed to use
Hello,
Please help with the below, I am trying to get dispense_quantity from
Dispense Model and subtract it from the quantity on Stock Model.
Then after that get something like this;
@property
def closing_stock(self):
return (self.quantity - self. quantity_issued )
class
UTC+5:30 jakartaman...@gmail.com wrote:
>
>> Hi Everyone
>>
>> I wanna question about the integer would input by models, with some class
>> ClassName
>> numb = models.IntegerField()
>> and the views is :
>> number = ClassName.objects.values_list('numb'
.
Regards
Chiranjeevi
On Monday, 30 May 2022 at 15:36:07 UTC+5:30 jakartaman...@gmail.com wrote:
> Hi Everyone
>
> I wanna question about the integer would input by models, with some class
> ClassName
> numb = models.IntegerField()
> and the views is :
> number = ClassNam
Hi Everyone
I wanna question about the integer would input by models, with some class
ClassName
numb = models.IntegerField()
and the views is :
number = ClassName.objects.values_list('numb', flat=True).distinct()
then the templates is :
1
2
3
4
5
so i call the number from django admin
"ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"
I need to chain my models to this api such that after selecting the
city,you a get a redirect to a form so you can fill in personal details
On Fri, May 6, 2022, 12:36 Muhammad Juwaini Abdul Rahman
wrote:
> Can you s
heir products based on their
>>> countries,States and cities.I got this api that show a drop down list based
>>> on country, states and cities.How do I chain my models to this api? Any
>>> leads will be appreciated.Thanks
>>>
>>> --
>>> You received t
ropdown-list-with-django.html
>
> On Thu, 5 May 2022 at 23:46, Heman Okumbo wrote:
>
>> I need to have clients posting their products based on their
>> countries,States and cities.I got this api that show a drop down list based
>> on country, states and cities.How do I ch
is api that show a drop down list based
> on country, states and cities.How do I chain my models to this api? Any
> leads will be appreciated.Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscri
I need to have clients posting their products based on their
countries,States and cities.I got this api that show a drop down list based
on country, states and cities.How do I chain my models to this api? Any
leads will be appreciated.Thanks
--
You received this message because you
Hello Derek,
Your solution worked, I appreciated the help.
Regards.
On Wednesday, April 20, 2022 at 5:50:25 PM UTC+3 Derek wrote:
> Not sure what the "@aproperty" are here for, but in your views.py file,
> you could do this calculation, passing in the ID of the staff record:
You've already posted the same question:
https://groups.google.com/g/django-users/c/f7ZH2pcZp0s
On Wednesday, 20 April 2022 at 16:44:19 UTC+2 techg...@gmail.com wrote:
> I have a model Staff and LeaveReportStaff, I wanted to get leave_balance
> between Total_Leave_Days and leave_days. I
Not sure what the "@aproperty" are here for, but in your views.py file, you
could do this calculation, passing in the ID of the staff record:
from .models import Staff, LeaveReportStaff
def get_leave_balance(staff_id):
total_leave_days = Staff.objects.get(pk=staff_id)
lea
I have a model Staff and LeaveReportStaff, I wanted to get leave_balance
between Total_Leave_Days and leave_days. I already used Foreignkey for
staff but I'm not sure if it is right to use Foreignkey again.
Please advise the best way forward.
class Staff(models.Model):
Total_Leave_Days =
Hello,
I have a model Staff and LeaveReportStaff, I wanted to get leave_balance
between Total_Leave_Days and leave_days.
Please advise the best way forward.
class Staff(models.Model):
Total_Leave_Days = models.PositiveIntegerField(default=0)
course = models.ForeignKey(Course,
gt; explore the use of its associated technologies which can meet your stated
> requirements.
>
> On Thursday, 10 March 2022 at 01:55:18 UTC+2 Ryan Nowakowski wrote:
>
>> On Sun, Feb 27, 2022 at 09:10:05AM +0530, Prashanth Patelc wrote:
>> > How to create dynamic models in django
530, Prashanth Patelc wrote:
> > How to create dynamic models in django rest framework?
> > Is there any chance to create dynamic models with APIs
> >
> > Any examples please send me thanks in advance..
> >
> > 1) Requirement is need create table name and fields in
On Sun, Feb 27, 2022 at 09:10:05AM +0530, Prashanth Patelc wrote:
> How to create dynamic models in django rest framework?
> Is there any chance to create dynamic models with APIs
>
> Any examples please send me thanks in advance..
>
> 1) Requirement is need create tab
On 28 Feb 2022, at 16:24, Prashanth Patelc wrote:
Any example?
Just read the django-extra-views documentation. Essentially a formset
can be as simple to use as any of the built-in class-based views, eg:
from extra_views import InlineFormSetView
class
Any example?
On Mon, Feb 28, 2022, 5:27 PM Clive Bruton wrote:
>
> On 27 Feb 2022, at 17:54, Steve Smith wrote:
>
> > ...the documentation on Formsets is scarce in my opinion and to get
> > them to work is a lot of trial and error...
>
> To massively simplify formsets try django-extra-views
>
>
On 27 Feb 2022, at 17:54, Steve Smith wrote:
...the documentation on Formsets is scarce in my opinion and to get
them to work is a lot of trial and error...
To massively simplify formsets try django-extra-views
-- Clive
--
You received this message because you are subscribed to the
Check out the api mentioned here
https://stackoverflow.com/questions/34768732/temporary-models-in-django#48042468
On Sun, 27 Feb 2022, 03:42 Prashanth Patelc,
wrote:
> How to create dynamic models in django rest framework?
> Is there any chance to create dynamic models with APIs
&
@googlegroups.com on behalf
of Antonis Christofides
Sent: Sunday, February 27, 2022 12:58 AM
To: django-users@googlegroups.com
Subject: Re: How to create dynamic models in django??
Short answer: I don't know. It probably isn't straightforward, but it's doable
in principle.
Longer answer: Django hasn't been
Refer here.https://docs.djangoproject.com/en/4.0/topics/db/models/
On Sun, Feb 27, 2022, 06:42 Prashanth Patelc
wrote:
> How to create dynamic models in django rest framework?
> Is there any chance to create dynamic models with APIs
>
> Any examples please send me thanks in adv
doing such things—it's likely to lead to an
unmanageable code mess. Keep it simple. Consider working without a relational
database.
Regards,
Antonis
Antonis Christofides
+30-6979924665 (mobile)
On 27/02/2022 05.40, Prashanth Patelc wrote:
How to create dynamic models in django rest framework
How to create dynamic models in django rest framework?
Is there any chance to create dynamic models with APIs
Any examples please send me thanks in advance..
1) Requirement is need create table name and fields in frontend
2) we are getting the data and store in to the db create db structure
3
hey ,
im working on dynamic models , im receiving model name and fields in
front-end
eg:
class Users(models.Model):
name=models.Charfield(max_length=30)
last_name=models.Charfield(max_length=30)
,,,
after this i dont need to save into the models.py i need to store the
data
Hi Django users,
I have a requirement to design and develop labels for mailing and ticketing
software.
you can call whatever you want to labels or tags or folders or hashtags
but how to design database for reusable case of designing database in
django tags
For example,
1. Mails
2. Ticketing.
Hello all,
I am curious if I can use the session.userid in a model FK restriction
query.
Thank you.
--
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
) To: Django users
Subject: Models Dear Django users,I need some
information regarding Django models, I would like to know is there any way to
create Django models through frontend or can we create models by super admin.
Kindly share any tutorials or any examples available.Example:we are create
Dear Django users,
I need some information regarding Django models, I would like to know is
there any way to
create Django models through frontend or can we create models by super
admin. Kindly share any tutorials or any examples available.
Example:
we are create models in django
like below
oblem occurs because for some reason my
>> request.POST data is empty.
>>
>> I found out because I wrote a custom CSRFfailureview where I print out my
>> request data.
>>
>> The reason I get a csrf is missing error is because that token is also
>> stored in th
e I wrote a custom CSRFfailureview where I print out my
> request data.
>
> The reason I get a csrf is missing error is because that token is also
> stored in there.
>
> Now I'm trying to figure out why my POST data is empty only on models
> where an filefield or imagefield is
out why my POST data is empty only on models where
an filefield or imagefield is defined...
On Tuesday, 21 December 2021 at 07:59:31 UTC+1 Yorben Verhoest wrote:
> Yes, I'm just using the DjangAdmin interface
>
> It works perfectly for models without any filefield / imagefield
> Fir
Yes, I'm just using the DjangAdmin interface
It works perfectly for models without any filefield / imagefield
First I thought that the connection between the app and the s3 bucket was
wrong, but when I test i through the shell, it works.
On Monday, 20 December 2021 at 19:50:28 UTC+1 phoebeb
e
> data in it.
> All of my models work fine when I try to save them except the ones that
> have a filefield or imagefield in them. When I save those, I get a 403 -
> CSRF token missing error.
>
> The weird thing is, working on localhost, It works perfectly, it even
> saves the file
I have a project which is set up on AWS using lambda, s3, ...
Because it is still in production we are using DjangoAdmin to manage the
data in it.
All of my models work fine when I try to save them except the ones that
have a filefield or imagefield in them. When I save those, I get a 403
gt; https://docs.djangoproject.com/en/3.2/ref/models/fields/#foreignkey
>
> In this case you would do
>
> created_by_id = models.ForeignKey("User", on_delete=models.DO_NOTHING)
>
> On Sep 23, 2021, at 1:50 AM, Bhavin Shah
> wrote:
>
> Hello,
>
> Somewhat n
You can put a string with the name of a class that is yet to be defined in the
ForeignKey.
https://docs.djangoproject.com/en/3.2/ref/models/fields/#foreignkey
<https://docs.djangoproject.com/en/3.2/ref/models/fields/#foreignkey>
In this case you would do
created_by_id = models.Fore
>
> On Saturday, 6 November 2021 at 12:44:05 UTC omark...@gmail.com wrote:
>
>> hi all
>> i want to sanitize 'content' field from XSS attacks in django models
>> so i installed 'bleach' and used but script like "an
>> evil() example" store as is (wi
validation in, then call super afterwards.
You could also look at django-bleach -
https://pypi.org/project/django-bleach/
On Saturday, 6 November 2021 at 12:44:05 UTC omark...@gmail.com wrote:
> hi all
> i want to sanitize 'content' field from XSS attacks in django models
> so i installe
hi all
i want to sanitize 'content' field from XSS attacks in django models
so i installed 'bleach' and used but script like "an
evil() example" store as is (without sanitize script)
Note: i need bleach via function in models
Any idea ?
Thanks
[image: bleach-Models.png]
--
Yo
tables with the third one so that its not a deadlock between the two
>
> On Thu, Sep 23, 2021 at 7:05 PM Bhavin Shah
> wrote:
>
>> Hello,
>>
>> Somewhat new to Django. I am trying to figure out the best way to
>> define/organize models in Django app which have interdepe
大家好
系統使用一段時間后,它滿足新的要求,需要添加一個新的表。如何使用它?
--
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
st 2021 at 16:14:04 UTC+1 abubak...@gmail.com wrote:
>>
>>> Hi Derek it is not difficult for me to write the model for the product
>>> entity. but there are also other diagrams that I want to convert into
>>> models. so I was just wanted to clear my concept.
>>>
21 at 16:14:04 UTC+1 abubak...@gmail.com wrote:
>
>> Hi Derek it is not difficult for me to write the model for the product
>> entity. but there are also other diagrams that I want to convert into
>> models. so I was just wanted to clear my concept.
>> I am confused in Super type
ote:
> Hi Derek it is not difficult for me to write the model for the product
> entity. but there are also other diagrams that I want to convert into
> models. so I was just wanted to clear my concept.
> I am confused in Super types and sub types as you can see an entity within
>
Hi Derek it is not difficult for me to write the model for the product
entity. but there are also other diagrams that I want to convert into
models. so I was just wanted to clear my concept.
I am confused in Super types and sub types as you can see an entity within
the entity. how should I convert
There is not sufficient data in that image to create models. You don't
know the field types, for example.
Once you have those, it should not be too hard e.g.:
from django.db import models
class Product(models.Model):
product_id = models.AutoField()
name = models.CharField( max_length
can anyone help me?
On Thu, Aug 26, 2021 at 9:32 AM DJANGO DEVELOPER
wrote:
> Currently, I am working on an inventory management system and I have got
> some UML diagrams and want to convert those uml diagrams into django
> models. So can anyone guide me on how to convert those UML
Currently, I am working on an inventory management system and I have got
some UML diagrams and want to convert those uml diagrams into django
models. So can anyone guide me on how to convert those UML diagrams into
django models?
an example is below of uml diagram
--
You received this message
Hello guys,can anyone help me to add skip logic to django models,
i feel too lazy to use Django Forms and then add javascript and jquery,
is there a way to add them directly to models?
Cheers
Winstone
--
You received this message because you are subscribed to the Google Groups
"Django
models.DecimalFIeld()
>>>Total_score = models.DecimalField(default = 0)
>>>
>>>*def save(self, *args, **kwargs):*
>>> * self.Total_score = self.maths_score + self.english_score*
>>> super(Student, self).save(*args, **kwar
_score = self.maths_score + self.english_score*
> super(Student, self).save(*args, **kwargs)
>
>
>
> or you can proceed with clean() method also.
> On Tuesday, June 15, 2021 at 11:34:37 AM UTC-7 adesolar...@gmail.com
> wrote:
>
>> How do I add two models together
() method also.
On Tuesday, June 15, 2021 at 11:34:37 AM UTC-7 adesolar...@gmail.com wrote:
> How do I add two models together in the database, two different
> DecimalField.
> i.e math_score + eng_score = total_score
>
--
You received this message because you are subscribed to the G
t; Regards
>
> Ridwan Adeyemo schrieb am Di., 15. Juni
> 2021, 20:34:
>
>> How do I add two models together in the database, two different
>> DecimalField.
>> i.e math_score + eng_score = total_score
>>
>> --
>> You received this message be
Hello,
You create all modelfields inkl. Total sum and after user submit Form with
2 fields in save() Method you sum both fields together ans write this in
total field...
Regards
Ridwan Adeyemo schrieb am Di., 15. Juni 2021,
20:34:
> How do I add two models together in the database,
Thanks for the response. Kindly explain more or provide image description.
Best regards
On Tue, Jun 15, 2021, 8:09 PM patel dhruvish
wrote:
> Use foreign key in 1 model for initiat another model...
>
> On Wed, Jun 16, 2021, 00:04 Ridwan Adeyemo
> wrote:
>
>> How do I ad
Use foreign key in 1 model for initiat another model...
On Wed, Jun 16, 2021, 00:04 Ridwan Adeyemo
wrote:
> How do I add two models together in the database, two different
> DecimalField.
> i.e math_score + eng_score = total_score
>
> --
> You received this message because
How do I add two models together in the database, two different
DecimalField.
i.e math_score + eng_score = total_score
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails fro
Hello,
i need a mixin where i can inherit many to many like this:
mixin.py:
class RightsModelRelation(models.Model):
user_link = models.ForeignKey(User, on_delete=models.CASCADE,
blank=False, null=False, default=None,
I think this the only way to lin different models with eachother. and I
would like to hear more about linking the models with each other if there
is anyone who can describe it to both of us.
On Wed, Jun 2, 2021 at 10:38 AM Ayush Bisht
wrote:
> thanks, .. it works for me.. but is there any ot
thanks, .. it works for me.. but is there any other way to do these ??. as
PatientVaccineStatus already connected to Patient model, and Vaccine
connected to PatientVaccineStatus model. Can't we merged all the tables of
descendants to their parent model in this hierarchy fashion without linking
btw have you applied in your models what I told you to do?
On Wed, Jun 2, 2021 at 10:31 AM Ayush Bisht
wrote:
> yes, its true, but here it works as candidate key. so that we can identify
> the patient based in ICMR id's.
>
> On Tuesday, June 1, 2021 at 1:34:24 AM UTC-7 abubak...@gma
yes, its true, but here it works as candidate key. so that we can identify
the patient based in ICMR id's.
On Tuesday, June 1, 2021 at 1:34:24 AM UTC-7 abubak...@gmail.com wrote:
> class Patient(models.Model):
> patient_id = models.CharField(max_length=60) # no need for adding
> patient
class Patient(models.Model):
patient_id = models.CharField(max_length=60) # no need for adding
patient id because django automatically creates ids
patient_vaccine = models.ForeignKey(PatientVaccine,
related_name="patient_vaccine")
vaccine = models.ForeignKey(Vaccinet,
class Vaccine(models.Model)
vaccine = models.ForeignKey(PatientVaccineStatus,
related_name="vaccine_status")
patient = models.ForeignKey(Patient, related_name="patient") # new line
apply this line and your patient model will be linked with Vaccine model
On Tue, Jun 1, 2021 at 11:06 AM
class Patient(models.Model):
patient_id = models.CharField(max_length=60)
class PatientVaccineStatus(models.Model):
patient = models.ForeignKey(Patient,
related_name="patient_vaccine_status")
class Vaccine(models.Model)
vaccine = models.ForeignKey(PatientVaccineStatus,
This kind of script can be dangerous. It’s possible for malicious websites to
create a page that can use up too many resources or otherwise act strangely.
URLValidator
advice
Thanks
*The profile model*
from django.db import models
from django.contrib.auth.models import User
import pyotp
import qrcode
# Create your models here.
def otp_google_auth(code,usr):
print('details: ',code,usr)
googleauth = pyotp.totp.TOTP(code).provisioning_uri(name=str
1 - 100 of 3971 matches
Mail list logo