Django views are MVC views; they control rendering (typically through templates), and the data displayed.
0
votes
2answers
11 views
null=True in model not accepting null values
views.py
report = Report.objects.get(user=user.id)
reportnotesform=ReportNotes(instance=report)
if request.method == 'POST':
locationnotesform=LocationNotes(request.POST,instance=report)
if ...
0
votes
2answers
14 views
Simple django pass paramaters from url
Im getting use to using urls to pass paramaters in django and i have the following url:
mywebsite/view-negotiation/?negotiation=7
I was expecting the following rule to catch it:
...
0
votes
1answer
13 views
Do I need another views file for my classes?
I am trying to make a calendar application. So I would need to make some classes to display the calendar and add events to it. Do those classes still go in my views file or do I have to make a ...
0
votes
2answers
29 views
typeahead autocomplete for Django
base.html
<html lang=en>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" ...
2
votes
2answers
26 views
No file was submitted. Check the encoding type on the form
below shows my example project. but it raise an error while submitting. i've added enctype to form field . but no way. please help :)
html
<form class="forms2" action="." method="post" ...
0
votes
1answer
26 views
Django — Pre-populating Hidden Fields
In my user signup process the user first creates their account, then creates a LIST object, and then is directed to the dashboard of the LIST object they just created. To achieve this I need to be ...
0
votes
0answers
22 views
Django error filter on ManyToMany relation
I would have all message about the request.user
Consider this code:
views.py
conversation = MessageConversation.objects.filter(Q(user=request.user.id) | Q(recipient=request.user)).order_by ...
0
votes
1answer
19 views
How do I get the value in my views? I am trying to use class based views
I am trying to send a variable using class based views. Below is the code for the url file
from django.conf.urls import patterns, include, url
from myapp.views import foo
urlpatterns = patterns('',
...
0
votes
2answers
33 views
django : using Q objects
I have these 2 queries :
gifts = Products.objects \
.filter(entry_query,in_stock__icontains='A-in') \
.filter(~Q(title__icontains='Not Found'))
and
gifts1 = Products.objects \
...
0
votes
2answers
28 views
Django Query Not Refreshing
I have built a Django site to list current and upcoming Service outages. The query is not refreshing unless I restart the Apache service. It will grab new messages I add but there is inconsistency.
...
1
vote
3answers
54 views
Can a django app have more than one views.py?
I have just started learning Django. I was wondering if Django app can have more than one views file? Let's say, I have two separate classes. Should I keep them in one views file or can I make two ...
0
votes
1answer
37 views
Django reverse returning empty string with unicode slug
I can't seem to figure out what is wrong with get_absolute_url of my model:
@models.permalink
def get_absolute_url(self):
print self.slug
return reverse('CategoryView', ...
0
votes
2answers
43 views
Referencing django.contrib.auth.login in Django templates
I am new to Django and am having difficulty with using django.contrib.auth.login.
My urls.py:
from django.conf.urls import patterns, include, url
from myapp import views
from django.contrib import ...
0
votes
1answer
21 views
Django 1.5 Generic view
I'm practicing django with "Practical Django 2nd edition" book, which is based on django 1.1
I installed django 1.5 so I should figure out the changes between django's versions and write the right ...
0
votes
1answer
16 views
Django Filter data from multiple Models
Here I used 4 models one is base models another three are derived model derived from base models. I want to filter data between these three models in which reference id is common one. I add code below ...