Hello,
I understand that Django won't let you save a incomplete fields in a single form created from a Model unless you do this:
tmpform = form.save(commit=False)
tmpform.foo = form.cleaned_data['foo']
tmpform.save()
So I want to do this kind of thing with forms in a formset - I am trying to to iterate through all the fields for eac...
I'm running Django behind Nginx (as FASTCGI) and I need to "deeplink" to a page in one domain from the root of another without redirecting or forwarding e.g.
Given that I have a domain general-stuff.com and a matching URL http://general-stuff.com/books/ and that I have a second domain books-stuff.com I need a way to get the page served ...
I have a form like this:
class MyForm(forms.Form):
[...]
which is rendered in my view:
if request.method == 'GET':
form = MyForm(request.GET)
Now, i want to add a form field which contains a set of values in a select-field, and the queryset must be filtered by the currently logged in user. So I changed the method signature so t...
Hi,
Im new in using Django, and i want to know if there is some way to have a multiple date selection from a calendar,
i have multiple days :
for example a day is :
[ 28 july 2009 8:30 - 28 july 17h00 ]
Is there any way to do this with Django Forms
Thanks a lot
kimo
...
Simple 'Example' - have millions of points within specific geography. Have everything loaded and able to see in GeoAdmin the whole 9 yards.
So. How do I show all points on a map - and base it on zoom level? Are there any simple examples out there?
...
Hey there,
I've been looking through the site and trying to find something to help me, but I can't find anything. I'll begin with showing the models that relate to this:
class Game(models.Model):
home_team = models.ForeignKey(Team, related_name='home_team')
away_team = models.ForeignKey(Team, related_name='away_team')
round ...
Hi SO,
This is probably a db design issue, but I couldn't figure out any better. Among several others, I have these models:
class User(models.Model):
name = models.CharField( max_length=40 )
# some fields omitted
bands = models.ManyToManyField( Band )
and
class Band(models.Model):
creator = models.ForeignKey( User )
# some...
Here'a an example:
If I have these classses
class Author(models.Model):
name = models.CharField(max_length=45)
class Book(models.Model):
name = models.CharField(max_length=45)
authors = models.ManyToManyField(Author)
In the database I have one Author with the name "George" and another one with the name "Georfe". The last...
It seems that if I do not create a ModelForm from a model, and create a new object and save it, it will not respect the field's upload directory.
How do I change the directory of a InMemoryUploadedFile so I can manually implement the upload dir? Because the InMemoryUploadedFile obj is just the filename, and I would like to add the uploa...
I wrote an application using Django 1.0. It works fine with the django test server. But when I tried to get it into a more likely production enviroment the Apache server fails to run the app.
The server I use is WAMP2.0. I've been a PHP programmer for years now and I've been using WAMPServer since long ago.
I installed the mod_wsgi.so an...
I'm running django 1.1rc. All of my code works correctly using django's built in development server; however, when I move it into production using Apache's mod_python, I get the following error on all of my views:
Caught an exception while rendering: Reverse for '<django.contrib.auth.decorators._CheckLogin
What might I look for that'...
Hello,
I am trying to make a many to one relationship and want to be able to control it (add -remove etc) via the admin panel. So this is my model.py:
from django.db import models
class Office(models.Model):
name = models.CharField(max_length=30)
class Province(models.Model):
numberPlate = models.IntegerField(primary_key=True...
I am using the threadedcomments module and need two changes:
- an additional field on the ThreadedComment model
- different fields on the form
I know the answer is to subclass but I'm not sure how to go about doing this - where does the code go?
...
I'd like to know how I can maintain sessions while developing on my local machine (django, apache, mod-wsgi).
Each time I make updates to python code I need to restart Apache for the changes to take effect.
...
I'd like to build a function in Django that iterates over a set of objects in a queryset and does something based on the value of an arbitrary attribute. The type of the objects is fixed; let's say they're guaranteed to be from the Comment model, which looks like this:
class Comment(models.Model):
name = models.CharField(max_length=...
How can write tag "copyblock" for Django templates?
For such a functional::
<title> {% block title %} some title... {% endblock %} </title>
<h1>{% copyblock title %}</h1>
Thx!
...
How do I have actions occur when a field gets changed in one of my models? In this particular case, I have this model:
class Game(models.Model):
STATE_CHOICES = (
('S', 'Setup'),
('A', 'Active'),
('P', 'Paused'),
('F', 'Finished')
)
name = models.CharField(max_length=100)
owner = mode...
I have a project written in Django. All fields that are supposed to store some strings are supposed to be in UTF-8, however, when I run
manage.py syncdb
all respective columns are created with cp1252 character set (where did it get that -- I have no idea) and I have to manually update every column...
Is there a way to tell Django to ...
Greetings, I have these 2 models:
from django.db import models
class Office(models.Model):
name = models.CharField(max_length=30)
person = models.CharField(max_length=30)
phone = models.CharField(max_length=20)
fax = models.CharField(max_length=20)
address = models.CharField(max_length=100)
def __unicode__(self)...
Maybe somebody can show an example of such a task, or specify where to look.
...