Re: Deployed url mapping

2007-02-18 Thread Malcolm Tredinnick
On Sat, 2007-02-17 at 23:42 -0800, kbochert wrote: > > > On Feb 17, 11:04 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: [...] > > It will very much vary on a per-host basis. Django code may not be > > responsible for serving all of the URLs for a particular site, for > > example. Somewhere

Re: Deployed url mapping

2007-02-18 Thread kbochert
On Feb 18, 12:05 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2007-02-17 at 23:42 -0800, kbochert wrote: > > > On Feb 17, 11:04 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > > wrote: > [...] > > > It will very much vary on a per-host basis. Django code may not be > > > responsible

Re: Deployed url mapping

2007-02-18 Thread Malcolm Tredinnick
On Sun, 2007-02-18 at 00:20 -0800, kbochert wrote: > > > On Feb 18, 12:05 am, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: [...] > > > > If you are really confused about this, then trying to install your app > > in a hosting environment without first testing it on your local machine > > with

Re: Deployed url mapping

2007-02-18 Thread kbochert
On Feb 18, 12:29 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2007-02-18 at 00:20 -0800, kbochert wrote: > No it doesn't *require* Apache, although that is one popular option. > Please read the installation documentation, which contains pointers to > setup instructions for other

Re: Deployed url mapping

2007-02-18 Thread ashwoods
i think you are a little confused. i'll try to clear things up. first, the url.py does not depend on the apache configuration in the sense you imply. but apache does have to know when to call the django/python handler, and that can be host based, directory based, virtualhost based (if the apache

Re: newforms select field

2007-02-18 Thread paulh
Thanks for the replies. As always, reading the docs again teaches you a bit more than the first time; I now see that that initial was not what I was after. Arnaud, I think your method is more what I was after and as you say, it does exactly what I wanted. It seems to be much simpler than overrid

Re: newforms select field

2007-02-18 Thread Honza Král
On 2/18/07, paulh <[EMAIL PROTECTED]> wrote: > > Thanks for the replies. As always, reading the docs again teaches you > a bit more than the first time; I now see that that initial was not > what I was after. > > Arnaud, I think your method is more what I was after and as you say, > it does exactly

ordering - how to using relation or db function

2007-02-18 Thread VIK_Tomas
Hi, how to set modelClass.Meta.ordering = ( ... ) for sorting same as "ORDER BY (description IS NULL)" or same as "ORDER BY LOWER(item)" Thx --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Deployed url mapping

2007-02-18 Thread kbochert
I think I almost get it. If I configure Apache as you suggest, and a user surfs to "www.mysite.com" what url gets 'passed' to urls.py? Will that url match: 1:(r'^$', 'mysite.myapp.views.index'), or 2: (r'^myapp/$', 'mysite.myapp.views.index'), or 3: (r'^index$', 'mysite.myapp.views.index'),

django admin - too many sql-queries

2007-02-18 Thread VIK_Tomas
Hi, I have db-model like this: class Action(models.Model): name = models.CharField(maxlength=64, unique=True) photo = models.ForeignKey('Photo', null=True, blank=True) class Album(models.Model): action = models.ForeignKey(Action, null=True, blank=True) name = models.CharField(maxle

{% url %} syntax in templates

2007-02-18 Thread omat * gezgin.com
I am running revision 4541 and experimenting with the new {% url path.to.view %} syntax. My template for displaying a set of thumbnail images is like: {% for photo in photo_set %} {% endfor %} And url pattern that matches the view is (r'^photo/(?P[-\w]+)/(?P\d+)/$', 'artist.views.artist_phot

see some picture

2007-02-18 Thread Urmila Mayra
Hi dear friend some pictures for you. See all the pictures one by one Ayesha Takia pictures. http://ifs1.imagefly.info/v/f9/jpg/aye16v.html http://ifs1.imagefly.info/v/55/jpg/aye17a.html http://ifs1.imagefly.info/v/cc/jpg/aye18v.html http://ifs1.imagefly.info/v/82/jpg/aye19a.html http:

Custom Admin save function

2007-02-18 Thread Florian Apolloner
How can I tweak the normal save button (by hooking into the save method) to, instead of updating the record, add it as new one and mark the old one as deleted (to mark it as deleted I would like to change an boolean attribute...)? Thx Florian --~--~-~--~~~---~--~

Re: Django over modpython

2007-02-18 Thread Benjamin Slavin
I second the SliceHost VPS recommendation... my experience with them has been nothing but positive. - Ben On 2/17/07, Scott Paul Robertson <[EMAIL PROTECTED]> wrote: > On Sat, Feb 17, 2007 at 04:41:46PM -, akonsu wrote: > > > > www.prgmr.com seem to have affordable VPS hosting. but i agree,

Django learning ? pay

2007-02-18 Thread enquest
Is it possible that I can pay somebody to help me learning Django/python. I'm starting a project with Django and don't want to get stuck. I simple want to ask quickly via Jabber. How do you do this/that and get some help on it. Maybe you can have some overview of what I'm doing and give pointers..

Re: Custom Admin save function

2007-02-18 Thread Honza Král
you simply override the save() function to do what you described: create another instance and mark this one as deleted... the only problem I can think of is with the instance for example if I do m = Model.objects.all()[0] m.some_field = 'new value' m.save() what is now in 'm' ?? the new obj

Re: django admin - too many sql-queries

2007-02-18 Thread Honza Král
On 2/18/07, VIK_Tomas <[EMAIL PROTECTED]> wrote: > > Hi, > > I have db-model like this: > > class Action(models.Model): >name = models.CharField(maxlength=64, unique=True) >photo = models.ForeignKey('Photo', null=True, blank=True) > > class Album(models.Model): >action = models.ForeignK

Dont Miss to see This.........

2007-02-18 Thread khaja mohaideen
You Learn From this How to in dollars within a week www.freewebs.com./khaja_mohai <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: ordering - how to using relation or db function

2007-02-18 Thread Honza Král
AFAIK this is currently not possible with django's ORM, you can work around that by using: queryset.order_by().extra( where=[ ' 1=1 ORDER BY whatever' ] ) which means: on queryset, reset sorting and to where clause append 1=1 (so if the SQL has correct syntax) and ORDER BY whatever... but I consi

Re: ManyToManyField does not allow empty relations

2007-02-18 Thread akonsu
thanks for your response. specifying null=True for ManyToManyField will allow nulls in the corresponding field in the association table, right? but since this table is just a list of pairs this is not needed because having no row at all has the same effect. correct? if so null=True is not really

Re: ManyToManyField does not allow empty relations

2007-02-18 Thread Honza Král
On 2/18/07, akonsu <[EMAIL PROTECTED]> wrote: > > thanks for your response. > > specifying null=True for ManyToManyField will allow nulls in the > corresponding field in the association table, right? but since this > table is just a list of pairs this is not needed because having no > row at all h

Re: django admin - too many sql-queries

2007-02-18 Thread VIK_Tomas
> > http://www.djangoproject.com/documentation/model_api/#list-select-related > a try add class Admin: list_select_related = True to all models, but it has no effect - "Edit Action" is still very slow. with this option in all models: 3598 queries without this option: 3598 queries -

Re: django admin - too many sql-queries

2007-02-18 Thread Honza Král
On 2/18/07, VIK_Tomas <[EMAIL PROTECTED]> wrote: > > > > > http://www.djangoproject.com/documentation/model_api/#list-select-related > > > > a try add > >class Admin: > list_select_related = True > > to all models, but it has no effect - "Edit Action" is still very > slow. > > with this o

Re: django admin - too many sql-queries

2007-02-18 Thread Tomáš Pokorný
models.py attached. On Sun, 2007-02-18 at 16:51 +0100, Honza Král wrote: > > that's odd can you post your Model definition? > > > > > > > > > > > -- TomᚠPokorný = email: [EMAIL PROTECTED] mobil: +420 776 379 631 icq# 22996508 == 1.Robotická s.r.o. h

Re: Custom Admin save function

2007-02-18 Thread Florian Apolloner
> you simply override the save() function to do what you described: > create another instance and mark this one as deleted... That's what I want to do > what is now in 'm' ?? the new object, the one merked for deletion? etc. > if you only need this in admin, then you shouldn't have to worry a

Re: Custom Admin save function

2007-02-18 Thread Honza Král
On 2/18/07, Florian Apolloner <[EMAIL PROTECTED]> wrote: > > > you simply override the save() function to do what you described: > > create another instance and mark this one as deleted... > That's what I want to do > > > what is now in 'm' ?? the new object, the one merked for deletion? etc. >

Re: django admin - too many sql-queries

2007-02-18 Thread Honza Král
On 2/18/07, Tom� Pokorn� <[EMAIL PROTECTED]> wrote: > models.py attached. > > > On Sun, 2007-02-18 at 16:51 +0100, Honza Kr�l wrote: > > > > > that's odd can you post your Model definition? definitely odd, list_select_related appears to have no effect on the sql queries. even if I add photo to li

Re: Custom Admin save function

2007-02-18 Thread Florian Apolloner
> def save( self ): > old_data = self.__class__.objects.get(pk=self.id).__dict__ > old_data['deleted'] = True > self.__class__.objects.create( **old_data ) > super( models.Model, self ).save() > > then when you do > > m = Model.objects.get(pk=42) > m.some_field='some new value' > m

how to count many-to-many relations?

2007-02-18 Thread akonsu
hello, class A(models.Model): bs = models.ManyToManyField('B') class B(models.Model): how to implement this query: select * from myapp_a inner join (select a_id, count(*) from myapp_a_bs group by a_id) as a on myapp_a.id=a

Re: newforms select field

2007-02-18 Thread paulh
As far as I can see the __init__ way of doing things creates a field as opposed to a base_field. Given that this is done in the __init__ method every instance will have this field. Is there any disadvantage in this? I suppose you could also have a base_field with the same name/ key. Looking at the

Re: {% url %} syntax in templates

2007-02-18 Thread Ivan Sagalaev
omat * gezgin.com wrote: > And url pattern that matches the view is > (r'^photo/(?P[-\w]+)/(?P\d+)/$', > 'artist.views.artist_photo'), > > Images are displaying fine but the links does not appear. (i.e. {% url > artist.views.artist_photo slug=artist.slug,id=photo.id %} does not > render anything.

beautiful pohos of Amrita Rao

2007-02-18 Thread Urmila Mayra
Hi Dear Friend. See all the pictures Amrita Rao picture http://ifs3.imagefly.info/v/f6/jpg/amr34a.html http://ifs3.imagefly.info/v/92/jpg/amr17v.html http://ifs3.imagefly.info/v/fa/jpg/amr18a.html http://ifs3.imagefly.info/v/3f/jpg/amr19a.html http://ifs3.imagefly.info/v/bc/jpg/amr20v.html ht

Re: rendering dynamic fields in newforms

2007-02-18 Thread [EMAIL PROTECTED]
Jeff, Looks like you are rendering out the form class itself rather than an instance of the form. You could try this approach. from django import newforms as forms from django.template import Context, Template from django.http import HttpResponse class MedForm(forms.Form): def __init__(self,

Re: django admin - too many sql-queries

2007-02-18 Thread Gary Wilson
On Feb 18, 10:48 am, "Honza Král" <[EMAIL PROTECTED]> wrote: > On 2/18/07, Tom? Pokorn? <[EMAIL PROTECTED]> wrote: > > > models.py attached. > > > On Sun, 2007-02-18 at 16:51 +0100, Honza Kr?l wrote: > > > > that's odd can you post your Model definition? > > definitely odd, list_select_related ap

Re: Custom Admin save function

2007-02-18 Thread Florian Apolloner
I got a few questions cause it is not working (I assume I am to silly): > def save( self ): > old_data = self.__class__.objects.get(pk=self.id).__dict__ I can substitue pk with id (this is my primary...) > old_data['deleted'] = True Mark the old_data as deleted > self.__class__.objects

Re: django admin - too many sql-queries

2007-02-18 Thread Honza Král
On 2/18/07, Gary Wilson <[EMAIL PROTECTED]> wrote: > > On Feb 18, 10:48 am, "Honza Kr�l" <[EMAIL PROTECTED]> wrote: > > On 2/18/07, Tom? Pokorn? <[EMAIL PROTECTED]> wrote: > > > > > models.py attached. > > > > > On Sun, 2007-02-18 at 16:51 +0100, Honza Kr?l wrote: > > > > > > that's odd can you po

Re: Custom Admin save function

2007-02-18 Thread Honza Král
On 2/18/07, Florian Apolloner <[EMAIL PROTECTED]> wrote: > > I got a few questions cause it is not working (I assume I am to > silly): > > def save( self ): > > old_data = self.__class__.objects.get(pk=self.id).__dict__ > I can substitue pk with id (this is my primary...) sure, that's exactly

Re: how to count many-to-many relations?

2007-02-18 Thread Honza Král
Hi, I believe you could use queryset.extra( select={ 'B_count' : 'SELECT COUNT(*) FROM myapp_a_bs WHERE a_id = myapp_a.id' } ) it will result in a slightly different, but equivalent, query: SELECT myapp_a.id, myapp_a, ..., ( SELECT COUNT(*) FROM myapp_a_bs WHERE a_id = myapp_a.id ) AS "B_

global name '_get_deleted_objects' is not defined

2007-02-18 Thread Robin Percy
Has anyone else run into the following error when deleting objects using the newforms-admin branch? Exception Value: global name '_get_deleted_objects' is not defined Exception Location: /usr/lib/python2.4/site-packages/django/contrib/admin/options.py in delete_view, line 466 Obviously _get_delet

Re: global name '_get_deleted_objects' is not defined

2007-02-18 Thread Honza Král
On 2/18/07, Robin Percy <[EMAIL PROTECTED]> wrote: > Has anyone else run into the following error when deleting objects using the > newforms-admin branch? > > Exception Value: global name '_get_deleted_objects' is not defined > Exception Location: > /usr/lib/python2.4/site-packages/django/contrib/a

Re: Custom Admin save function

2007-02-18 Thread Florian Apolloner
2007/2/18, Honza Král <[EMAIL PROTECTED]>: > I just wrote it into the email as an example of how I would go about > doing something like this, I said you will have to tweak it a bit, try > it in shell first and see how its behaving... I got something like this now: def save(self): try

Re: Custom Admin save function

2007-02-18 Thread Honza Král
On 2/18/07, Florian Apolloner <[EMAIL PROTECTED]> wrote: > > 2007/2/18, Honza Kr�l <[EMAIL PROTECTED]>: > > I just wrote it into the email as an example of how I would go about > > doing something like this, I said you will have to tweak it a bit, try > > it in shell first and see how its behaving.

Re: how to count many-to-many relations?

2007-02-18 Thread akonsu
thanks. this is good enough, although in general having to fall back to sql is not portable between different database engines. i think that at least having methods that return the names of the underlying database tables and/or fields would be helpful. so that i could use them in stead of 'myapp

Re: django admin - too many sql-queries

2007-02-18 Thread James Bennett
On 2/18/07, VIK_Tomas <[EMAIL PROTECTED]> wrote: > class Action(models.Model): >name = models.CharField(maxlength=64, unique=True) >photo = models.ForeignKey('Photo', null=True, blank=True) Set 'raw_id_admin=True' on the 'photo' field -- otherwise Django will query the full list of Photos

Re: django admin - too many sql-queries

2007-02-18 Thread Honza Král
On 2/18/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 2/18/07, VIK_Tomas <[EMAIL PROTECTED]> wrote: > > class Action(models.Model): > >name = models.CharField(maxlength=64, unique=True) > >photo = models.ForeignKey('Photo', null=True, blank=True) > > Set 'raw_id_admin=True' on the 'ph

Re: Django over modpython

2007-02-18 Thread Grupo Django
I can't afford it right now. I would be good anyway. In bluehost, they offer me modpython, but i have some questions about that. First of all, modpython is running through cgi. As Nathan said, this would be a a loss of permormance, but what about security? I have read that with fastcgi, only one i

Re: Django over modpython

2007-02-18 Thread Robert Coup
[EMAIL PROTECTED] wrote: > Yes, most of the hostings have fastCGI, but not flup. > I know the best is to have VPS hosting, but they are very expensive, > and I think I can manage with a shared hosting. > I think Blouehost looks good. > For VPS i can't recommend http://www.rimuhosting.com/ enoug

Re: how to count many-to-many relations?

2007-02-18 Thread Malcolm Tredinnick
On Sun, 2007-02-18 at 21:36 +, akonsu wrote: > thanks. > > this is good enough, although in general having to fall back to sql is > not portable between different database engines. It usually is possible, providing you get the table and column names correct (as you indicate below). The main

Re: Deployed url mapping

2007-02-18 Thread Malcolm Tredinnick
Somebody else has posted an alternative phrasing of the solution, but let's just clear up a couple of items for the archives... On Sun, 2007-02-18 at 00:51 -0800, kbochert wrote: [...] > So perhaps "install apache and mod_python" really means "insure that > your host has apache and mod_python ins

Re: {% url %} syntax in templates

2007-02-18 Thread omat * gezgin.com
Thank you Ivan, the check list helped a lot. Now it is working. The problem was, I was including a not-yet-existing urls.py in the root urls.py. This doesn't cause any problem as long as its pattern is not matched. But if you try to do the reverse match with the {% url %}, it fails if there is a

Re: {% url %} syntax in templates

2007-02-18 Thread Malcolm Tredinnick
On Sun, 2007-02-18 at 23:26 +, omat * gezgin.com wrote: [...] > Another thing is that, if there are multiple patterns matching the > same view function, it seems like, only the first match is considered. > Lets say the artist_photo function has an optional "id" parameter > which defaults to No

Re: Django over modpython

2007-02-18 Thread akonsu
> First of all, modpython is running through cgi. As Nathan said, this > would be a a loss of permormance, but what about security? I have read 1. to me, the phrase "modpython is running through cgi" makes no sense. do you mean to say "python is running through cgi"? 2. what kind of security do

Re: rendering dynamic fields in newforms

2007-02-18 Thread Rubic
On Feb 18, 12:00 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Looks like you are rendering out the form class itself rather than an > instance of the form. Monster, Thanks, but Honza had the correct reply. I need to access the individual fields in the template, and BoundField is the way

Re: how to count many-to-many relations?

2007-02-18 Thread akonsu
> > You can extract this information from the _meta attribute on a model. > This isn't documented (yet), but it's on the TODO list for things to > document before 1.0. > thanks, i will check out this _meta attribute. it seems to me that ManyToManyField is not a field, it is a table. so if we did

download computer books for free

2007-02-18 Thread [EMAIL PROTECTED]
Free Computer Education Ebooks,Tutorials and much more ASP, Business, C++, Careers, CISCO, e-books, Engineering, English, Filmmaking, Finance, Health, Leadership, Management, Marketing, Mathematics, Mobile, Oracle, Perl , Photography, PHP, Programming, VOIPand much more visit htt

Admin without Auth

2007-02-18 Thread kbochert
Is there a was to install the contrib.admin app without the contrib.auth app?? While learning, I am eraseing the database and doing manage.py syncdb a lot, and it would be real nice to have it come up without having to enter username email etc. each time. Karl --~--~-~--~~-