I have several forms each having a hidden field that identifies this form...I want to check for this field in my view then based on the result determine which form will be processed. How should i go about this?
...
Reader's Digest version: How do I get data (either single row if specified or full table) from a model by taking a URL argument of the model's name without hardcoding the URLconfs to match each model? For more details, read on:
I'm making an app that has three models, and I want to make a simple view that takes a name of a model, and sp...
Is it possible to set a form's ForeignKey field's queryset so that it will take separate queryset's and output them in <optgroup>'s?
Here is what I have:
views.py
form = TemplateFormBasic(initial={'template': digest.template.id})
form.fields['template'].queryset = Template.objects.filter(Q(default=1) | Q(user=request.user)).order_by('...
I have created a Profile model including the Gender info. There is also models called Dorm and Registration (not used for user registration) like this:
class Registration(models.Model):
user = models.ForeignKey(User)
pref1 = models.ForeignKey(Dorm, related_name="pref1",verbose_name=u"Preference 1",null=True)
...
friend1 = models.CharFie...
I'm facing very strange issue, I'm getting JSON object from django powered site and excuting it using eval(). It works on all the other browsers except all versions of IE. in IE, I am getting "variable_name" is null or not an object. I've tried everything I could but so far no luck.
here is my json object
var results = {"result":[
{
...
I'm having issues with ManytoMany Relationships that are not updating
in a model when I save it (via the admin) and try to use the new value within a
function attached to the post_save signal or within the save_model of
the associated AdminModel.
I've tried to reload the object within those functions by using the
get function with the id...
I have a website that processes user submitted documents in a variety of ways, one of which is to do a spell check on a part of each document. When I set this website up on a Mac Mini (yes, I realize that's a pretty weak piece of equipment for a website, but it's internal and no one outside the office sees it), I remember having some tr...
I have built an XML-RPC interface in Python and I need to enforce some stricter typing. For example, passing string '10' instead of int 10. I can clean this up with some type casting and a little exception handling, but I am wondering if there is any other way of forcing type integrity such as something XML-RPC specific, a decorator, o...
It is running under DEBUG = True mode. Sometimes it can throw out an error message with traceback information when encounter an error but sometimes it just display the following lines:
Unhandled Exception
An unhandled exception was thrown by the application.
I have to switch to development server to see detail message.
How can I mak...
So, every so often you get sites like http://www.twitmaps.com - sites created quickly and pushed online for a random purpose.
Often either you have plenty of spare time, or you just don't have the opportunity to get your own ideas online. For example in this one, the snow images are very vague and could do with more accuracy.
What too...
My local machine is running with Python 2.5 and Nginx on Ubuntu 8.10, with Django builded from latest development trunk.
For every url I requested, it thrown out:
TemplateDoesNotExist at /appname/path
appname/template_name.html
Django tried loading these templates, in this order:
* Using loader django.template.loaders.filesystem.funct...
I have a model
class Employee_Type(models.Model):
def __unicode__(self):
return self.name
name = models.CharField(max_length=200, verbose_name="employee type")
class Employee(models.Model):
def __unicode__(self):
return self.name
name = models.CharField(max_length=200)
type = models.ForeignKey(Employ...
Hi - I'm looking to deploy a django app on AWS (since I have some credit coupon) and am looking for a good place to read about it - mostly b/c I never used it before. thanks
...
Hi,
Trying to upload my django app on my obunto slice. The problem I'm facing right now there are a couple of packages I'm using. Which I installed in site packages on my machine. Now when I put them online on the server their sadly not working. Any ideas how to make them work.
p.s I get a error on import
...
Hi,
I would like to parse the content of a textarea in my django view, line by line (or get a specific line number).
Thanks
...
In django when updating a global dictionary data structure I want to lock access to it by different request. I am planning to have a wrapper funtion to update and access and synchronize it. Coming from java background! Any pointers?
...
I have both, django and mysql set to work with UTF-8.
My base.html set utf-8 in head.
row on my db :
+----+--------+------------------------------------------------------------------+-----------------------------+-----------------------------+---------------------+
| id | psn_id | name ...
Hi,
I'm using Django/Python , I need to ask the user for permission to let me put feeds ( ideally oneliners which was not working so I thought to use full streams) into the user profile.
Would you like to receive email from our application?
This is giving me a hyper link which I click and it shows me the permission box. What is need...
Hi all,
I am going to use email as a username across the website, however I still need to pre-fill the mandatory username field in User model somehow.
Initially I was thinking of using a md5 hash of the email as username, but given the limitation of 30 characters it is not possible. Also I don't think I can use GUIDs for that as they a...
I've found a few posts that are similar in nature to this but they haven't been 100% clear so here goes:
In my views I have an add_album view that allows a user to upload an album. What I'd like to do is clean the form (AlbumForm) to check if this album is unique for an artist.
My AlbumForm looks like this:
class AlbumForm(ModelForm)...