All Questions
11 questions
0
votes
1
answer
2k
views
Django foreign key is not set and hence unable to save form
I have a simple foreign key relationship between two tables. I am able to save the parent, but am unable to save the child which has a foreign key to the parent. This is what my models look like:
...
1
vote
0
answers
114
views
Programmatically set the model on a class based view in Django 1.3
I'm trying to implement a more generic version of the Django class based detail view, which can operate on different models when required. The idea was to set the model using a parameter in the URL, ...
0
votes
1
answer
488
views
Update a count variable in model object
What I want to do is simple I want to update the count variable of the object every time my view function is called.
My models is like this:
class Url(models.Model):
#some vars here
...
2
votes
1
answer
2k
views
Function-based generic views have been deprecated
DeprecationWarning: Function-based generic views have been deprecated; use class-based views instead.
I keep getting this warning, when I'm running my site. What does this mean and how can I fix it?
1
vote
1
answer
1k
views
django-userena views.py and user registration issues
django-userena does not have a views.py file. It uses instead html files, i would like to use this views.py instead of the html files, because i want to add some other features, like a file uploader. ...
0
votes
1
answer
3k
views
Django redirecting to another view with a bound form
I am using Python 2.7, Django 1.3.1.
I am trying to implement a sign in functionality that can be called from arbitrary page and redirects to the same page without any code duplication. The current ...
1
vote
1
answer
2k
views
display json dictionary values in templates
I am doing ajax using jquery in django1.3,well its works fine. Am using jquery load method to fill a in a template.
I get a json object asychrosily when user cliks in a button.I pass it to another ...
0
votes
3
answers
210
views
django foreign key complex query
I know this is dumb but...
I have two model classes
class Gallery(models.Model):
name = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published', auto_now_add=True)
...
6
votes
1
answer
4k
views
Class based view extending UpdateView not saving form correctly
Im trying to save a form using UpdateView in Django 1.3 and seemed to have run into a problem. When I am saving the form, it POST's to the current URL and the success url is the same url.
When saving ...
3
votes
2
answers
5k
views
Django get() takes exactly 2 arguments (3 given)
I am trying to use DetailView generic class in my test app and this is what I have in my view
*updated model * from this example
class AuthorDetailView(DetailView):
context_object_name = "...
9
votes
2
answers
4k
views
How to specify something other than pk or slug for DetailView
I was wondering if it was possible to use something besides a pk or slug when you are using a DetailView in Django 1.3.
For example, I currently have:
url(r'^mymodel/(?P<pk>\d+)/$', ...