Re: caching questions

2006-03-02 Thread [EMAIL PROTECTED]
Adrian Holovaty wrote: > > - the admin site is cached too, which makes it a bit hard to use. > > it might be a middleware ordering problem, but I haven't found a > > working combination. any ideas? > > Ah, you must be using the per-site cache, right? I'm actually not sure > how the per-site cache

Re: limiting foreign key choices in a selection field

2006-03-02 Thread Nebojša Đorđević
sam wrote: > Nesh: > > Your method works. Thanks very much! > > Now a tougher situation: > > I want to have the same form to enter "part" information, except the > maker field I want to split into two fields: "category" and "maker". I > want to show different selections in the "maker" field bas

view on site

2006-03-02 Thread Mary Adel
i created my website using flatpages and they are amazing for me and i am very happy for that but their is a button on the page on the right hand side called (view on site) and when i clicked on it it gave me error says page not found what should i do to make this button work Thanks, Mary --~-

Template tags for sorting based on table headers

2006-03-02 Thread Chetan Vaity
Hi all,Here is a first cut implementation for a custom template tag which makes providing sorting on table headers easy.Assume that your model is something like:class Vegetable(meta.Model):    name = meta.CharField ()    wt = meta.PositiveIntegerField()    You will need to do the following things t

Re: Django captcha problems

2006-03-02 Thread syhpoon
Error occurs when I try to load template with form that is protected with captcha, i.e. when I put {%load captcha%} {%captcha%} into my template, without these lines it renders fine, but, naturally without captcha image. The strangest thing for me is that, as I've mentioned before, with django int

Re: view on site

2006-03-02 Thread Amit Upadhyay
Hi Mary,Put (r'^r/', include('django.conf.urls.shortcut')), in your URLConf.On 3/2/06, Mary Adel <[EMAIL PROTECTED]> wrote:i created my website using flatpages and they are amazing for me and i am very happy for that but their is a button on the page on the righthand side called (view on site) and

Re: MySQL + FastCGI + Dreamhost = Trouble with foreign key in admin

2006-03-02 Thread Julio Nobrega
Can you paste the query here? I think the problem is an unsupported feature by Mysql... Do you have another Mysql install to test? On 3/2/06, Colleen Owens <[EMAIL PROTECTED]> wrote: > > I forgot to say this is with current Django trunk. > > -- Forwarded message -- > From: Colle

Recursive ForeignKey with blank=True

2006-03-02 Thread David Ascher
I'm trying to model an employee database, with the reporting relationship modeled as (using magic-removal):class Person(models.Model):    ...    reports_to = models.ForeignKey("self", blank=True, null=True) I need the blank=True because I'd like to avoid the bootstrapping problem in the admin UI th

You are Invited

2006-03-02 Thread students
This is to Inform you that you have been invited to join our Students Community It has loads of members with loads of stuff ..register now its free ..dont miss it http://www.studentshangout.com --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: view on site

2006-03-02 Thread Mary Adel
I did that but their is something that is very strange happened when i click on the view on site button it goes to microsoft site which is strange for me :( On Thu, 2006-03-02 at 18:00 +0530, Amit Upadhyay wrote: > Hi Mary, > > Put (r'^r/', include('django.conf.urls.shortcut')), in your URLConf.

Re: view on site

2006-03-02 Thread Konstantin Shaposhnikov
On 3/2/06, Mary Adel <[EMAIL PROTECTED]> wrote: > > I did that but their is something that is very strange happened when i > click on the view on site button it goes to microsoft site which is > strange for me :( You should edit details about your Site object in Admin application. By default doma

Re: MySQL + FastCGI + Dreamhost = Trouble with foreign key in admin

2006-03-02 Thread Colleen Owens
I'm not sure what query the admin interface is sending exactly, but I was able to reproduce this at the command line with just these simple commands. (I'm not sure--is there some easy way to spit out the SQL associated with these commands?) >>> from django.models.polls import polls >>> from datet

Re: MySQL + FastCGI + Dreamhost = Trouble with foreign key in admin

2006-03-02 Thread Colleen Owens
Okay, I figured out what the SQL query is that's causing this error: INSERT INTO `polls_choices` (`poll_id`,`choice`,`votes`,`_order`) VALUES (7, `not much`, 0,(SELECT COUNT(*) FROM `polls_choices` WHERE `poll_id` = 7)) ERROR 1093 (HY000): You can't specify target table 'polls_choices' for updat

Re: Django captcha problems

2006-03-02 Thread Luis Armendariz
syhpoon wrote: > Error occurs when I try to load template with form that is protected > with captcha, i.e. when I put {%load captcha%} {%captcha%} into my > template, without these lines it renders fine, but, naturally without > captcha image. The strangest thing for me is that, as I've mentioned

Re: Recursive ForeignKey with blank=True

2006-03-02 Thread akaihola
Strange, since for me a similar case works in the current magic-removal. And your DB is up-to-date with the Django model? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Some function are missing from my Django objects

2006-03-02 Thread Martin Ostrovsky
Hi, I have a ManyToMany relationship between 2 classes as below: class Places(meta.Model): class People(meta.Model): places = ManyToManyField(Places) >From command line, everything is OK. But within a view, an instance of the People class will not have a method get_places_list(). I

Re: Some function are missing from my Django objects

2006-03-02 Thread Martin Ostrovsky
Found the problem. Was importing the wrong models class. Was using the direct path to my models rather than django.models.app_name. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to th

how to process dictionaries in templates

2006-03-02 Thread Bill de hÓra
I'm trying to understand how dictionary lookups work in templates. To that end I'm passing in a dictionary of lists like this, allyears = {"2002":["a","b","c"], "2003":["a","b","c"]} return render_to_response('press/inthepress_index', "allyears":allyears,) into the template, ie in the w

Re: Django in a Load-Balanced environment (ORM issues) ...

2006-03-02 Thread Jonathan Ellis
On 2/28/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: Alternatively, SQLAlchemy solves this problem by implementing anidentity map, which is quite cool. You should be able to useSQLAlchemy with the rest of Django with no problems at all -- the onlything you won't be able to take advantage of is th

Ordering with respect to a function in models?

2006-03-02 Thread Malcolm Tredinnick
Consider something like a tag hierarchy model: class Tag(models.Model): name = models.CharField(maxlength = 50, unique = True) parent = models.ForiegnKey('self', related_name='child', null = True, blank = True)

Dreamhost - agh!

2006-03-02 Thread Bryant
I posted once, earlier, about problems I've been having getting Django to run on a basic Dreamhost account. I've followed the instructions at http://wiki.dreamhost.com/index.php/Django to the letter, and Django is running just fine, from a command line. FCGI is working - my hello.fcgi correctly re

Re: how to process dictionaries in templates

2006-03-02 Thread oggie rob
You can quite easily do this with nested lists. Just have the following structure for each item in the allyears list: ["2005", ["a","b","c"],] then you can reference each item by number: {% for yearitem in allyears %} {{ yearitem.0 }} {% for item in yearitem.1 %} {{ item }} {% endfor %

Re: how to process dictionaries in templates

2006-03-02 Thread Malcolm Tredinnick
Hi Bill, On Thu, 2006-03-02 at 23:29 +, Bill de hÓra wrote: > > I'm trying to understand how dictionary lookups work in templates. To > that end I'm passing in a dictionary of lists like this, > > allyears = {"2002":["a","b","c"], "2003":["a","b","c"]} > return render_to_response('press

Re: how to process dictionaries in templates

2006-03-02 Thread Malcolm Tredinnick
On Fri, 2006-03-03 at 13:28 +1100, Malcolm Tredinnick wrote: > Hi Bill, > > On Thu, 2006-03-02 at 23:29 +, Bill de hÓra wrote: > > > > I'm trying to understand how dictionary lookups work in templates. To > > that end I'm passing in a dictionary of lists like this, > > > > allyears = {"20

Re: how to process dictionaries in templates

2006-03-02 Thread oggie rob
> Err.. I suck. This should be {% for data in allyears.items %}. :-( Yep, that may work, but leaves the ordering up to the "items" method, which isn't going to be ideal. In the case that you use a dict, you should probably also use dictsort to make sure you get what you expect: {% for data in all

Re: Dreamhost - agh!

2006-03-02 Thread Jeremy Jones
On Fri, 03 Mar 2006 01:18:42 - "Bryant" <[EMAIL PROTECTED]> wrote: > > I posted once, earlier, about problems I've been having getting Django > to run on a basic Dreamhost account. I've followed the instructions at > http://wiki.dreamhost.com/index.php/Django to the letter, and Django > is r

Re: how to process dictionaries in templates

2006-03-02 Thread Malcolm Tredinnick
On Fri, 2006-03-03 at 03:33 +, oggie rob wrote: > > Err.. I suck. This should be {% for data in allyears.items %}. :-( > > Yep, that may work, but leaves the ordering up to the "items" method, > which isn't going to be ideal. Good point. > In the case that you use a dict, you > should prob

Re: Dreamhost - agh!

2006-03-02 Thread Eugene Lazutkin
Bryant wrote: > > FastCGI: comm with (dynamic) server > "/home/[username]/[domainname]/django.fcgi" aborted: (first read) idle > timeout (120 sec) > FastCGI: incomplete headers (0 bytes) received from server > "home/[username]/[domainname]/django.fcgi" I didn't see these messages before. > Plea

Re: Dreamhost - agh!

2006-03-02 Thread Adrian Holovaty
On 3/2/06, Jeremy Jones <[EMAIL PROTECTED]> wrote: > I'm starting to think if you want to be one of the cool kids, you need > to find hosting elsewhere. I've been moderately unhappy at times with > my Dreamhost account. I'll have to do some soul-searching when my year > is up as to whether I wan

Re: Dreamhost - agh!

2006-03-02 Thread patrick k
again, from one of my many discussions with dreamhost. dreamhost says: "Currently demand for django is not very high. If the demand picks up we will likely add direct support for it. This is why we added Ruby on Rails support." "It (Django) is currently not installed by default, again, because