How to enable Static Generator

2010-05-20 Thread vikk
Hi all,

I got some of the documents to enable static generator but still for
away from the result.
Please show me the way to implement it for my site so that I can
enhance the performance.
I am using apache + mod_wsgi.
I need to get detail about the apache configuration. How can I
configure it for the specific urls ?

Thanks in advance for your valuable reply.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



limit choices in the drop down of subcategory based on related category in Django admin

2010-06-04 Thread vikk
Hi,

I have three models as

class Category(models.Model):

name = models.CharField(max_length=128)


class SubCategory(models.Model):
category = models.ForeignKey(Category)
name = models.CharField(max_length = 400)

class Document(models.Model):
category = models.ForeignKey(Category, null=True, blank=True,
help_text=_('Required'))
subcategory = models.ForeignKey(SubCategory, null=True, blank=True,
help_text=_('Required'))
title = models.CharField(max_length=300)

Now in Admin interface I have category, subcategory and title field.
If a user is trying to select any subcategory then only that
subcategory item should be displayed which are related to Category.
A simple example is Country, state dropdown.
I am trying to get it from Modelform like

class DocumentAdminModelForm(ModelForm):

def __init__(self, *args, **kwargs):
super(DocumentAdminModelForm, self).__init__(*args,
**kwargs)
self.fields['sub_category'] =
forms.ModelChoiceField(queryset =
SubCategory.objects.filter(category__id = self.fields['category'] ))

but it is not working. Should I use some ajax and jquery for this or
is there any other way you can suggest ??

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.