In PHP you can create form elements with names like:
category[1]
category[2]
or even
category[junk]
category[test]
When the form is posted, category is automatically turned into a nice dictionary like:
category[1] => "the input value", category[2] => "the other input value"
Is there a way to do that in Django? request.POST.getli...
Hi
I have a two models, Model1 and Model2.
Model2 has a FK to Model1 and FK to iteself.
In the admin I show Model2 as inlines in Model1 change_form.
I want to modify the way the inlines are shown in the admin.
I need to group all the instances that have the same parent_model2 and display them as
a readonly field with a string of 'child...
I'm trying to figure out how to integrate django-registration with django-paypal. Being a Django n00b, I'm trying to figure out how to implement a flow like this:
User signs up using django-registation with 'active' flag set to 0
After registering, send user to PayPal for a subscription
When they come back from PayPal successfully, I ...
I'm trying to modify a Django form to use a textarea instead of a normal input for the "address" field in my house form. The docs seem to imply this changed from Django 1.1 (which I'm using) to 1.2. But neither approach is working for me. Here's what I've tried:
class HouseForm(forms.ModelForm):
address = forms.Textarea() # Should...
I have a Django project where the company will have a main site like www.ourcompany.org and a bunch of sub-domains like project.ourcompany.org. Content appearing in the sub-domains like case studies should also appear in the main site. I've decided to use multiple instances of Django BUT one database for each sub-domain so that I can hav...
All,
i have the following model defined,
class header(models.Model):
title = models.CharField(max_length = 255)
created_by = models.CharField(max_length = 255)
def __unicode__(self):
return self.id()
class criteria(models.Model):
details = models.CharField(max_length = 255)
headerid = models.Forei...
How do I download image from datastore in app engine and Django without using Wsgi Request Handler.
...
My questions seems like a common problem that when I have seen any questions on it is never really asked right or not answered. So Im going to try to get the question right, and maybe someone knows how to resolve the issue, or correct my understanding.
The problem:
When you have a many-to-many relation ship (related_name not through) a...
I noticed in the main Django introductin they show a feature that maps python objects to the database. This doesn't strike me as being mutually exclusive with with development, is there any reason why this can't be used for non web apps? Is it easy to separate out?
...
In the following model:
class header(models.Model):
title = models.CharField(max_length = 255)
created_by = models.CharField(max_length = 255)
def __unicode__(self):
return self.id()
class criteria(models.Model):
details = models.CharField(max_length = 255)
headerid = models.ForeignKey(header)
def __unic...
I have two models like this:
class OptionsAndFeatures(models.Model):
options = models.TextField(blank=True, null=True)
entertainment = models.TextField(blank=True, null=True)
seats_trim = models.TextField(blank=True, null=True)
convenience = models.TextField(blank=True, null=True)
body_exterior = models.TextField(blank=Tr...
Hello, I am researching about how to set up CI and continuous deployment for a small team project for a Django based web application. Here are needs:
Developer check in the code into a hosted SVN server (unfuddle.com)
A CI server detects new checkin, check out the source, build, run functional tests.
If tests all passed, deploy the cod...
In a harrowing attempt to get mod_wsgi to run on CentOS 5.4, I've added python 2.6 as an optional library following the instructions here. The configuration seems fine except that when trying to ping the server the Apache log prints this error:
mod_wsgi (pid=20033, process='otalo',
application='127.0.0.1|'): Loading
WSGI script '...
I have this test case
def setUp(self):
self.user = User.objects.create(username="tauri", password='gaul')
def test_loginin_student_control_panel(self):
c = Client()
c.login(username="tauri", password="gaul")
response = c.get('/student/')
self.assertEqual(response.status_code, 200)
the view associated with the test cas...
I'm building a website in django that needs to extract key words from short (twitter-like) messages.
I've looked at packages like topia.textextract and nltk - but both seem to be overkill for what I need to do. All I need to do is filter words like "and", "or", "not" while keeping nouns and verbs that aren't conjunctives or other parts ...
It appears Django hides fields that are flagged Primary Key from being displayed/edited in the Django admin interface.
Let's say I'd like to input data in which I may or may not want to specify a primary key. How would I go about displaying primary keys in the admin interface, and how could I make specifying it optional?
...
Hi folks,
I've built a web application with Django, I'm using Memcached in order to cache data.
A few views cache the whole HttpResponse objects, therefore there might be a better alternative for returning the Memcached data other than going through Django.
What could be faster alternatives for returning Memcached data on HTTP Request...
I am using gae with django.
I have an project named MusicSite with following url mapping-
urls.py
from django.conf.urls.defaults import *
from MusicSite.views import MainHandler
from MusicSite.views import UploadHandler
from MusicSite.views import ServeHandler
urlpatterns = patterns('',(r'^start/', MainHandler),
(r'^upload/', ...
I am creating multisites platform. Anybody can make simple site, with my platform. I plan to use django multidb support. One db for one site. And i need to change db settings depending on request.get_host().
I think that i's not good idea. Prompt other decisions? How it is realised on various designers of sites?
...
In my django views i have the following
def create(request):
query=header.objects.filter(id=a)[0]
a=query.criteria_set.all()
logging.debug(a.details)
I get an error saying 'QuerySet' object has no attribute 'details' in the debug statement
.What is this error and what should be the correct statemnt to query this.And the mode...