I'm not sure what you are trying to achieve, but you probably don't want
all of the models to use the same primary key.
You can access the primary key though via the pk or id attributes. For
instance:
Grade.objects.all().values("subjt_id", "subjt__pk", "subjt__profile_id",
"subjt__profile__pk")
Hi,
Did you try
SomeModel.objects.filter(data__name__contains="ar")
If you want to union the results from both fields you can use a Q object:
https://docs.djangoproject.com/en/2.0/topics/db/queries/#complex-lookups-with-q-objects
And that would look something like:
complex_query = Q(data__na
Hi Caleb,
I think there should be a comma here
basic.html' {'content'
so it should be
basic.html', {'content'
Hope that helps!
On 5/30/2018 5:45 PM, Caleb Bryson wrote:
I can not seem to figure out what the syntax error is in line 7 of
this code, can anyone help
from django.shortcuts impo
You might want to use window functions
https://docs.djangoproject.com/en/3.0/ref/models/expressions/#window-functions
to calculate the sum per month. Haven't personally used them yet though.
On 3/11/2020 8:27 AM, Mario Bisiani wrote:
Yes. I am using Chart.js. Any help?
Il giorno giovedì 5 ma
Hi,
Aren't you looking for the AutoField?
https://docs.djangoproject.com/en/2.0/ref/models/fields/#autofield
It will automatically increment based on each record added to the table.
As an aside, the problem you are having is that in python, the first
argument to a class is a reference to the
Hello,
You are correct, creating a one-to-one relationship can potentially
create more queries and hurt performance if you are not careful.
However it can also speed up certain queries if you don't need that
information all of the time.
If you are worried about the performance, I would sugg
Hey Mike,
I'm not sure about your specific setup, but I assume you are using the
django.contrib.auth user model and are moving it over to your own app,
and you have your own userprofile model that links to it. The user
model in django.contrib.auth is a swappable model. Basically meaning as
7 matches
Mail list logo