queryset objects in which user has an object
App has Game model and Player model.
queryset objects in which user has an object
App has Game model and Player model.
How to handle two IDs for one endpoint in Django URL patterns and templates?
How to manage two primary keys when constructing urlpatterns
in Django for one endpoint(i.e involve two primary keys)
creating a django project using 3.9.18 version in anconda prompt
i want to create a djongo project using python version = 3.9.18 . in my system i intalled python version is 3.12.4. how i can do this . my project related to the virsion is 3.8.18
Django DateField persistence
I have a model / Form / view for a request that works well, but when I want to update a request all the fields are loaded except the due_date field (with a date widget) witch remains empty. If I don’t pay attention I validate and the due_date become None. I would like it to load the date that was saved during creation by default and then I modify it or not. Here is the code.
In Django, how do I pass custom information from the user signup html form to the models?
In my Django project, I have two types of profiles (person and business). Based on the form a user fills in signup.html (which is very rudimentary right now) one of the types profiles will be created.
Reverse for ‘post_detail’ with arguments … not found
i’m having NoReverseMatch error message. already spend hours everything looks ok to me but couldn’t figure it out. I would appreciate any help. thanks
Raw input being recorded but data is not saving throwing “this field is required” error
For context, I’ve essentially got a form whereby the user fills in job details and can choose who was on the job from an existing list of workers and input their hours, rates, and total wages. I’ve implemented a script so the user can ‘add’ more workers to the form. The main issue is that the data is not saving specifically for the hours and rates field even though the wages field is, so I cannot submit the whole form. Given the JS is client-side it is more likely a django problem, I’ve tested it anyway by getting rid of my script.
Testing concurrency ability of a Django app
Let’s suppose I have a Django app named MyApp
in which I have a Django model called MyModel
. This model has a method called process
. The database is Postgresql so it allows concurrent queries.
Django: models.Model.objects.filter(pk) return nothing
I started learn Django framework.
Following the official tutorial I have model Question that is derived from django.db.models.Model
After all migrations, In views.py I created function called detail that is supposed to show me question by quest_id here is the code