I want to return the 2 or n records matches
that appear but shows me the following exception
Exception Value:
get () returned more than one File - it returned 2!
The Query that returns the exception
queryModeloArchivo= Archivo...
In my settings.py file I put the following:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'djangoproject',
'USER': 'root',
'PASSWORD': '',
'HOST': 'localhost',
'POR...
I just installed what bitnami 2.0.4 is in its latest version and I have a problem wanting to create a new project, by doing the command
django-admin.py startproject myproyect
At first I got an error that the django-admin file did not exist...
I am generating a view to search for products and I want to modify it to also search for users when the name starts with '@'.
Right now I have this view:
class BusquedaView(FilterView):
model = Producto
filterset_class = BusquedaFil...
I am trying to make a query that I return the number of orders that your delivery date is during the weekend between 7 am - 11 am and I have been trying this way:
Order.objects.filter(delivery__range=[breakfast_start_date, datetime.now()],
sta...
I am creating a task in Django where I need to take all the orders and check the creation date to see how much time has elapsed, in case 2 days have passed to execute a code and in case 4 have passed, execute a different one.
Right now my mod...
I have 2 test models, Model1 and Model2. Model2 has the OneToOneField key to Model1, but I can not assign the Model1_id to Model2_id to keep the relationship of the models, I do not know how to access that data from the views.py to assign it in...
I have been trying for several days to find the answer to this problem. I have tried with the solutions suggested in the threads that I found in which other users had something similar, but none has worked so far.
I created a contact form fol...
I have a template base.html of which the rest of my templates expand it by means of the label extends , an example of the code of the file base.html is the following:
{% load static %}
<!DOCTYPE html>
<html>
<...
I am working on a system where there are real estate companies, which publish real estate and these have cover photos. I need to save the cover images of the properties in a route similar to this: /media/id_de_inmobiliaria/id_inmueble/portada...