Re: ImageField not deleted while changing

2011-02-27 Thread Borislav Petrović
As far as I know, you should implement the file deletion by yourself. You should code it on the Models delete function. preserving the default behaviour. here is a link to some read: http://docs.djangoproject.com/en/dev/topics/db/models/#overriding-model-methods How you do the file deletion is jus

How to reduce DB queries?

2011-02-27 Thread galago
Models: class Technology(models.Model): name = models.CharField(max_length=100, unique=True) slug = models.SlugField(max_length=100, unique=True) class Site(models.Model): name = models.CharField(max_length=100, unique=True) slug = models.SlugField(max_length=100, unique=True)

Re: ImageField not deleted while changing

2011-02-27 Thread Artur Wdowiarski
Borislav is right, although it seems to me that overriding the model's save method would be more appropriate in Your case. On the other hand, You really should think twice before doing so. There's actually a good reason for django orm not to delete the actual file after the corresponding FileField

mistake in admin home page

2011-02-27 Thread vladimir
Please help me, why do I get such a form of admin home page (after autentification): http://www.google.com/url?sa=D&q=https://docs.google.com/leaf%3Fid%3D0B5W4njXO9ND_YmY0ZGQ4NTktZWZiZC00MzU3LWI5ZWEtYTFmM2JkODY5YmEy%26hl%3Den%26authkey%3DCMCK6uQG -- You received this message because you are subs

Re: admin home page

2011-02-27 Thread veva...@yandex.ru
error # 1 I can't understand at all, error # 2 is because of errors in urls.py files (project level and/or application level), but I cannot find them exactly. Please help On 26 фев, 21:58, vladimir wrote: > 1. Studying example in "The Definite Guide to Django. 2nd ed. > A.Holovaty, J.Kaplan-Moss

Re: admin home page

2011-02-27 Thread s . apostolico
error #1: seems that the browser is not able to load static resources ( css ). If you had firebug try to check the "net->All" panel for errors Stefano 2011/2/27 veva...@yandex.ru : > error # 1 I can't understand at all, > error # 2 is because of errors in urls.py  files (project level and/or >

Re: How to reduce DB queries?

2011-02-27 Thread s . apostolico
Take a look to : http://docs.djangoproject.com/en/1.2/ref/models/querysets/#select-related and http://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#regroup Stefano 2011/2/27 galago : > Models: > class Technology(models.Model): >     name = models.CharField(max_length=100, uni

Re: How to reduce DB queries?

2011-02-27 Thread galago
I use select_related(). How to apply it with regroup? I haven't use it before. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to dja

Re: admin home page

2011-02-27 Thread Vladimir
1) firebug shows nothing in "net->all" panel, 2) the same result is in Firefox 3.6.13, Internet Explorer 8, Google Chrome -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsu

Re: How to reduce DB queries?

2011-02-27 Thread galago
In template in main loop I want to display all technologies assigned to the each site. Technologies are assigned by m2m relation. So I run subloop as You can see in code above. I want to reduce the number of queries executed by those subqueries. I want to know, if there is a better way to do thi

Re: admin home page

2011-02-27 Thread s . apostolico
nothing ? is it enabled ? Please indicate: - django version - the value of MEDIA_ROOT, MEDIA_URL, ADMIN_MEDIA_PREFIX - urls.py 2011/2/27 Vladimir : > 1) firebug shows nothing in "net->all" panel, 2) the same result is in > Firefox 3.6.13, Internet Explorer 8, Google Chrome > > -- > You received

Re: admin home page

2011-02-27 Thread Vladimir
Django 1.2.3, in settings.py I have not edit this values: MEDIA_ROOT = '' MEDIA_URL = '' ADMIN_MEDIA_PREFIX = '/media/' urls.py: from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patter

Re: How to reduce DB queries?

2011-02-27 Thread Artur Wdowiarski
Actually, select_related won't help You with m2m fields. As it's written in docs linked by s.apostolico, it only works with ForeignKeys... As far as I know, there's no way to avoid the extra query using django's orm. 2011/2/27 galago > In template in main loop I want to display all technologies

Re: Browsing through media files on remote machine

2011-02-27 Thread Jagdeep Singh Malhi
On Feb 27, 1:01 am, Borislav Petrović wrote: > Hello, > >         Is there an app, or a suggestion on how to browse through media > files on a remote machine? > > I have a setup that would include two separate machines one from a web > hosting for my django site and another that would host media

Re: How to reduce DB queries?

2011-02-27 Thread s . apostolico
Artur is right, I did not see that you use m2m. S. 2011/2/27 galago : > In template in main loop I want to display all technologies assigned to the > each site. Technologies are assigned by m2m relation. So I run subloop as > You can see in code above. I want to reduce the number of queries execu

Re: admin home page

2011-02-27 Thread Stefano
seems that django is not able to decode the .css files try to open /contrib/admin/media/css/base.css with notepad and check it's content S. 2011/2/27 Vladimir : > Django 1.2.3, > > in settings.py I have not edit this values: > MEDIA_ROOT = '' > MEDIA_URL = '' > ADMIN_MEDIA_PREFIX = '/media/' > >

Re: admin home page

2011-02-27 Thread Vladimir
/* DJANGO Admin styles */ body { margin: 0; padding: 0; font-size: 12px; font-family: "Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; color: #333; background: #fff; } /* LINKS */ a:link, a:visited { color: #5b80b2; text-decoration

Re: admin home page

2011-02-27 Thread Vladimir
is it a good idea to delete Django from Python27/Lib/site-packages and install Django-1.2.5 ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, sen

Re: How to reduce DB queries?

2011-02-27 Thread Doug Ballance
Could you do a ManyToMany relationship through an intermediary model, and then query the intermediary using select related? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To un

Re: admin home page

2011-02-27 Thread Stefano
I use virtualenv so can test my app with multiple django version easy. http://pypi.python.org/pypi/virtualenv S. 2011/2/27 Vladimir : > is it a good idea to delete Django from Python27/Lib/site-packages and > install Django-1.2.5 ? > > -- > You received this message because you are subscribed t

Re: admin home page

2011-02-27 Thread Vladimir
I have installed Django-1.2.5. No effect. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.co

Re: mistake in admin home page

2011-02-27 Thread Lee Hinde
On Sun, Feb 27, 2011 at 5:46 AM, vladimir wrote: > Please help me, why do I get such a form of admin home page (after > autentification): > > http://www.google.com/url?sa=D&q=https://docs.google.com/leaf%3Fid%3D0B5W4njXO9ND_YmY0ZGQ4NTktZWZiZC00MzU3LWI5ZWEtYTFmM2JkODY5YmEy%26hl%3Den%26authkey%3DCMC

Re: Query Builder forgets annotations

2011-02-27 Thread Karen Tracey
On Sat, Feb 26, 2011 at 12:39 PM, Pascal Germroth wrote: > It seems the query builder forgets annotations when dealing with joins: > > Not in my experience. > > I have this model with Postgresql, Django 1.3 alpha 1 (SVN rev. 15659): > I don't quite understand that Django rev spec. r15659 is qui

Re: Query Builder forgets annotations

2011-02-27 Thread Pascal Germroth
Hi, >> It seems the query builder forgets annotations when dealing with joins: > Not in my experience. Yeah I experimented further and it wasn't actually a problem with /that/ part of the query (well, it changed when I added/removed the order_by, but the actual cause was some interference once it

Some cache problems

2011-02-27 Thread galago
1. I'm wondering if I can delete a cached content made in template cache. I want to delete it from my view. I have in my template {% cache 500 cache_name sites.number %} Is it possible to delete all "cache_name" cached content within the view, for example when some action is made? 2. I want to

How to check if string is in Hebrew

2011-02-27 Thread ydjango
Hebrew is within the unicode range 0x590 to 0x5ff. I tried if lang_string[0] >= u'0x590' and lang_string[0] <= u'0x5ff': but it does not seem to work. How do I check if lang_string is in Hebrew or not. Using Python 2.5, Django 1.2 -- You received this message because you are subscribed to the

ax variables from google using django.auth.openid

2011-02-27 Thread Josh Stratton
I've successfully setup django.auth.openid to do to the login through google, and I see that it will prompt the user for releasing their e- mail. However, I don't see anything available that let's me query the e-mail. Where is that information stored? request.user somewhere? -- You received th

Re: how to get attribute of intermediary model?

2011-02-27 Thread Margie Roginski
Ah yes, that is *much* better. Thank you! Sorry for the delay, forgot to check back on this thread till now. Margie On Feb 17, 2:28 pm, Daniel Roseman wrote: > On Thursday, February 17, 2011 10:06:40 PM UTC, Margie Roginski wrote: > > > Thanks for your reply, Daniel.  I didn't give my example

Re: admin home page

2011-02-27 Thread Vladimir
To Lee Hinde: Thank You. You answered me: Your browser's not finding the admin media location to load the css. Look at the docs for ADMIN_MEDIA_PREFIX. (I think that's the one...) I have looked: ADMIN_MEDIA_PREFIX Default: '/media/' The URL prefix for admin media -- CSS, JavaScript and images used

Re: How to check if string is in Hebrew

2011-02-27 Thread Ori Livneh
On Sun, Feb 27, 2011 at 6:01 PM, ydjango wrote: > Hebrew is within the unicode range 0x590 to 0x5ff. > > I tried > if lang_string[0] >= u'0x590' and lang_string[0] <= u'0x5ff': > > but it does not seem to work. > > How do I check if lang_string is in Hebrew or not. Using Python 2.5, > Django 1.2

urls.py usage

2011-02-27 Thread Vladimir
2. Studying example (CMS) in "Python Web Development with Django. J.Forcier, P.Bissex, W.Chun" I have got an error: https://docs.google.com/leaf?id=0B5W4njXO9ND_Mzg1M2U0ZGItYzZiMS00Y2Qx... adding detailes. I study CMS project in Chapter 8 in that book. Following authors I wrote: 1) project level c

Extend admin template without copying the whole template

2011-02-27 Thread Martin Brochhaus
Hi all, I want to add a language switcher below the breadcrumb to all my django admin pages. Therefore I created templates/admin/base.html in my project. However I don't want to copy the whole original base.html and add my changes - this would defeat the DRY principle and it would be a mainten

Re: Extend admin template without copying the whole template

2011-02-27 Thread Alex Boyko
On Monday, 28 February 2011, Martin Brochhaus wrote: > Hi all, > I want to add a language switcher below the breadcrumb to all my django admin > pages. > Therefore I created templates/admin/base.html in my project. However I don't > want to copy the whole original base.html and add my changes -

Re: Extend admin template without copying the whole template

2011-02-27 Thread Martin
Hi Alex, many thanks for your suggestion but I think {{ block.super }} will not help. In order to have a parent template I would first have to write something like {% extends "admin/base.html" %} but this already is not possible because it would mean inheriting itself. Best regards, Martin On Mo

AW: combobox

2011-02-27 Thread Szabo, Patrick (LNG-VIE)
Thx, i'll give it a shot ;-) . . . . . . . . . . . . . . . . . . . . . . . . . . Patrick Szabo XSLT-Entwickler LexisNexis Marxergasse 25, 1030 Wien mailto:patrick.sz...@lexisnexis.at Tel.: +43 (1) 534 52 - 1573 Fax: +43 (1) 534 52 - 146 -Ursprüngliche Nachricht- Von: django-users@