I cannot get the admin module to inline two same field models in one-to-one relations. To illustrate it, I've made the following example, a model Person uses two addresses:
class Client(models.Model):
# Official address
official_addr = models.OneToOneField(Address, related_name='official')
# Temporary address
temp_addr =...
I have a number of forms, say 5, I want to display them as page 1[ 1,2,3], page 2 [4], page3[5], as in one page having multiple forms. Is thsi possible with formwizard?
...
As you can see by reading my other thread today here, I'm having some troubles upgrading Python.
At the moment I have Python 2.4 with Django installed on a CentOS machine. However I've recently deployed an application that requires 2.5 which has resulted in me installing that and getting into a whole load of mess. My original assumption...
I would like to run some environment checks when my django process starts and die noisily in the case of an error. I'm thinking things like the database has an incorrect encoding or the machine has a python version we don't support.
I'd rather our team be faced with a fatal error that they have to fix, rather than be able to ignore it.
...
Hello, I need to create multilingual website. But there is a problem with the login address.
Do you know, how I can have /login/ for EN and /prihlasit/ for CS, etc... ?
I can specify just one login url in my settings.py
...
i want to make message view show all other messages that led up to that message. the original message will not have a response_to value and should terminate the recursion. is there a better way to do this? (i'm looking at memory over speed, because a thread shouldn't typically be more than 10 - 20 messages long).
def get_thread(msg,msg_...
I'm putting together a Web site that makes heavy use of images. Those images need to be thumbnailed at various sizes to fit different templates.
I'm aware of solutions like sorl-thumbnail, which seems perfect in every way except one: I need to be able to override automatic resizing and cropping if the computer's choice is a bad one.
Fo...
I'd like to write a django-admin action (for use when the user selects zero or more rows) that will allow them to edit the selected items as a group. I only need to edit one of the items in the model (the "room") at a time, but I don't want to have to go through all 480 of my objects and manually edit them one-by-one.
Is there a way to ...
I've got Hudson up and running, building Django and Python projects I'm working on.
I've found and am using the [Plot plugin][2] to graph Pylint scores, by extracting them with Awk to create a pylint.properties file.
So far everything is working great, but I'd like to have the Pylint score appear on the project page. Right now you have...
I'm new to django-lean.
Does anyone know where are the reports generated by calling manage.py update_experiment_reports are stored?
...
I continue to have problems setting up a GeoDjango installation that uses Spatialite as a backend on a Windows machine.
I used the GeoDjango installer and downloaded the precompiled libraries from http://www.gaia-gis.it/spatialite/binaries.html, and dumped them into my geodjango/bin directory.
I upgraded my pysqlite2 installation to th...
I want that Apache and Pinax only deliver Attachments to authenticated users.
I found this post, but i can't make it work.
My Apache-conf-file:
WSGIPythonPath /usr/local/bin/python
<VirtualHost *:80>
ServerName www.domain.com
ServerAlias domain.com
WSGIDaemonProcess k-production python-path=/path/to/app/pinax-...
I'm using Django to send an e-mail which has a text part, and an HTML part. Here's the code:
subject = request.session.get('email_subject', None)
from_email = request.session.get('user_email', None)
to = request.session.get('user_email', None)
bcc = [email.strip() for email in request.session.get('email_recipients', Non...
I have a django project set up with an app called pub. I'm trying to set it up so that I can include urls.py from each app (there will be more as I go) in the top-level urls.py. I've also got a template that uses the 'url' function to resolve a url on a view, defined in the openidgae module. The problem is that after the httprequest i...
i have this code in my tests.py:
from models import *
and in the models.py I have a signal handler and register it with
post_save.connect( post_save_note, sender=Note )
and when i run test with ./manage.py test main
I found the signal handler was registered twice and executed twice,
and I found it's because the models was imported ...
I'm building a navigation menu in my django app, and one of the options is "My Account". There are different roles I have for users, but in order for them all to view their profile, I use a generic URL such as http://mysite/user//profile.
What's a Django best practice for building this url using templates?
Is it simply something like:
...
I was wondering if there a way I can pass two or more variables in a custom manager...there are five variables that come from different views but in the model, I've declared a manager to handle filtering based on one of these variables...I want to have all the variables being considered in the filter query. Is there a way to do this?
c...
I'm trying to build a blog app and the problem is when I use tag 'truncatewords_html' in my template to truncate posts longer than specified words, I need to link to complete post by some title like 'read more...' after truncation. So I should know that the post was truncated or not.
P.S.: Is this a pythonic way to solve the problem?
...
I'm doing file uploads using Django's File Upload mechanism with a custom handler (by subclassing django.core.files.uploadhandler.FileUploadHandler) which does some additional processing in the
receive_data_chunk(self, raw_data, start) function.
I was curious when the handler is actually called (i.e. after the file has been completely ...
I have a model called Item, with m2m relation to User ("owner").
For each item, i need to count users who own it. That's easy enough with annotate()
But then i need to calculate ratio between owners of specific gender and total owner count for each item. For example if, 2 males own the item out of 5 users, the ration is 0.4.
What's th...