Re: mod_python/django problems

2007-08-03 Thread Kenneth Gonsalves
On 03-Aug-07, at 6:36 PM, David Reynolds wrote: >> per server. i have a situation where i have many small sites. >> anybody here using mod_python for larger number of sites per server? > > We have around 30 and have noticed the problems you've mentioned.. could you mention what exactly the

Re: UnicodeEncodeError

2007-08-03 Thread Alexandre Forget
thanks the help I am using a modified version of django-forum, replacing those __str__ with __unicode__ did the job alex On 8/1/07, Thomas Guettler <[EMAIL PROTECTED]> wrote: > > Am Mittwoch, 1. August 2007 04:23 schrieb Alexandre Forget: > > Hi, > > > > I am stuck with this error, does

Re: age in years calculation

2007-08-03 Thread Sean Perry
On Aug 3, 2007, at 9:57 AM, Doug Van Horn wrote: def age(d, bday): > ... return (d.year - bday.year) - \ > ... ((d.month, d.day) < (bday.month, bday.day) and 1 or 0) Or to be a little more explicit about it: def age(d, bday): return (d.year - bday.year) - \

Re: Only save if changed?

2007-08-03 Thread Forest Bond
On Fri, Aug 03, 2007 at 08:57:10PM -, [EMAIL PROTECTED] wrote: > For anyone trying this, I had to make it > old_self = self.__class__.objects.get(id = self.id) > instead of > old_self = self.__class__.get(id = self.id) Right, that's what I meant :) -Forest -- Forest Bond

Re: mod_python/django problems

2007-08-03 Thread Graham Dumpleton
On Aug 3, 9:16 pm, Aljosa Mohorovic <[EMAIL PROTECTED]> wrote: > on few blogs/web sites it is stated that > 30 django sites on one > server running apache/mod_pythonhave some issues, like untraceable > errors and wrong site displaying for some domain. > any comments on this? > > i have many small

Windows XP tips and tricks

2007-08-03 Thread Vladimir Rakita
Windows XP tips and tricks. Learn how to bypass very common windows problems, to speed up your system and make it more reliable with useful tips and tricks. http://windowsxpsp2pro.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are

Re: Trouble with installing stockphoto

2007-08-03 Thread Danno
Thanks for gettin back to me! I got that part figured out. Thank you! On Aug 2, 2:18 am, yml <[EMAIL PROTECTED]> wrote: > Hello, > > It looks like your "base.html" is in a folder which is not defined in > the "TEMPLATE_DIRS". In order to fix your problem you should add this > directory to this

Error was: 'module' object has no attribute 'process_register'

2007-08-03 Thread Fabien Schwob
Hello, I'm currently rewriting a website to take advantage of the new new features of the trunk. I'm using named urls and the {% url %} tag. But from time to time, I get the following errors : ViewDoesNotExist at / Tried process_register in module chibbi.club.views. Error was: 'module'

Re: css 404?

2007-08-03 Thread Tyson Tate
On Aug 3, 2007, at 2:29 PM, [EMAIL PROTECTED] wrote: > I have a template directory having home.html in it. home.html has > , but the > server always 404s the css _only_, whether it is written as home.css > or ./home.css. > Emphasizing here that home.html and home.css are in the same directory >

Re: Do I have to send shopping cart data to every template in my app?

2007-08-03 Thread oggie rob
If you really need to use a tag, look at http://www.djangoproject.com/documentation/templates_python/#passing-template-variables-to-the-tag But I think you probably would find it easier to add an extra context processor & avoid the tag altogether. -rob On Aug 3, 6:01 am, Greg <[EMAIL

css 404?

2007-08-03 Thread [EMAIL PROTECTED]
I've got a seemingly simple setup that I'm having problems with. The urlconf is: == from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template urlpatterns = patterns('', # Example: # (r'^home/', include('home.foo.urls')), # Uncomment this for

Re: Compare column entries in database query

2007-08-03 Thread [EMAIL PROTECTED]
Hi Russ! Thanks for the info! Saves me from trying around more. Yours, Thomas On Aug 2, 1:25 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 8/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > I want to find all entries in a database where two specific fields are > >

Re: Only save if changed?

2007-08-03 Thread [EMAIL PROTECTED]
On Aug 3, 3:44 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Thanks! > > On Aug 3, 3:04 pm, Forest Bond <[EMAIL PROTECTED]> wrote: > > > On Fri, Aug 03, 2007 at 07:37:17PM -, [EMAIL PROTECTED] wrote: > > > > In my site_users model (which extends auth user), I've got: > > > > def

Re: Only save if changed?

2007-08-03 Thread [EMAIL PROTECTED]
Thanks! On Aug 3, 3:04 pm, Forest Bond <[EMAIL PROTECTED]> wrote: > On Fri, Aug 03, 2007 at 07:37:17PM -, [EMAIL PROTECTED] wrote: > > > In my site_users model (which extends auth user), I've got: > > > def save(self): > > self.geocode = self.get_geocode() > >

Re: Only save if changed?

2007-08-03 Thread Forest Bond
On Fri, Aug 03, 2007 at 07:37:17PM -, [EMAIL PROTECTED] wrote: > > In my site_users model (which extends auth user), I've got: > > def save(self): > self.geocode = self.get_geocode() > super(SiteUser, self).save() # Call the "real" save() method. > > get_geocode makes a

Re: Job Fair F/OSS project

2007-08-03 Thread [EMAIL PROTECTED]
Well, all that stuff is still up in the air. This is the very-very beginning of the project. I think the first thing I'd like to do is to setup a site, like google code or sourceforge. If anyone has a suggestion about which one is better, that'd be great. I know they all use SVN (I use Git), so

Only save if changed?

2007-08-03 Thread [EMAIL PROTECTED]
In my site_users model (which extends auth user), I've got: def save(self): self.geocode = self.get_geocode() super(SiteUser, self).save() # Call the "real" save() method. get_geocode makes a call out to google's geocoding service, gives the city and state, and returns the

Re: Queryset of instances bound to particular ForeignKey

2007-08-03 Thread Benjamin Goldenberg
Hi Colin, The problem is that there are multiple ForeignKeys in A bound to instances of B, but I only want the instances of B bound to a specific foreignkey. Does that make sense? -Benjamin On Aug 3, 12:17 am, Collin Grady <[EMAIL PROTECTED]> wrote: > I feel silly for not trying this earlier,

Re: django app for managing sending email to users...

2007-08-03 Thread James Tauber
Great, I'll start something at Google Code Project Hosting and whatever you (or anyone else) can help with will be most welcome. django-mailer will probably be the project name. James On 03/08/2007, at 5:12 PM, Jacob Kaplan-Moss wrote: > > On 8/3/07, James Tauber <[EMAIL PROTECTED]> wrote:

Re: django app for managing sending email to users...

2007-08-03 Thread James Tauber
On 03/08/2007, at 5:55 PM, Bram - Smartelectronix wrote: > I'm exactly in the same situation, with the same needs for > splicemusic.com. Right now I have a big loop which goes over all > users, > and for each user checks if there are any new events that happened. > > This scales really badly,

Re: age in years calculation

2007-08-03 Thread Doug Van Horn
On Aug 3, 11:50 am, Doug Van Horn <[EMAIL PROTECTED]> wrote: > On Aug 3, 6:37 am, Bram - Smartelectronix <[EMAIL PROTECTED]> > wrote: [snip] You see, you learn something new every day. Based on Nis Jørgensen's post above, here's a refined age function using the fancy tuple comparison I didn't

Re: django app for managing sending email to users...

2007-08-03 Thread Bram - Smartelectronix
Jacob Kaplan-Moss wrote: > On 8/3/07, James Tauber <[EMAIL PROTECTED]> wrote: >> I was thinking of developing a django app for this with support for >> queuing and throttling of sends, scheduled sends, and logging of mail >> failures. I'm NOT interested at all in using it for unsolicited email >>

Re: age in years calculation

2007-08-03 Thread Doug Van Horn
On Aug 3, 6:37 am, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > Hey Everyone, > > does anyone have a good age in years calculation function for usage with > datetime.date that returns the age in nr of years of a person? > > We were using: > > def get_age(self): > now = datetime.today()

Re: age in years calculation

2007-08-03 Thread Nis Jørgensen
Lucky B skrev: > how about surrounding the statement with a try and work the leap year > to regular year case with the exception? That seems like overkill. There isn't really any leap-year handling necessary: import datetime.date as date def age (d1, d2=None): if not d2: d2 =

Re: django app for managing sending email to users...

2007-08-03 Thread Jacob Kaplan-Moss
On 8/3/07, James Tauber <[EMAIL PROTECTED]> wrote: > I was thinking of developing a django app for this with support for > queuing and throttling of sends, scheduled sends, and logging of mail > failures. I'm NOT interested at all in using it for unsolicited email > (although unfortunately

Re: mod_python/django problems

2007-08-03 Thread Jacob Kaplan-Moss
On 8/3/07, Aljosa Mohorovic <[EMAIL PROTECTED]> wrote: > on few blogs/web sites it is stated that > 30 django sites on one > server running apache/mod_python have some issues, like untraceable > errors and wrong site displaying for some domain. > any comments on this? When something like this

Amazon S3 and S3FileField

2007-08-03 Thread John-Scott
Is anyone out there using S3FileField (http://code.djangoproject.com/ wiki/AmazonSimpleStorageService) in their models to interface with Amazon's S3 service? I've saved the code from the above url into a file 'amazon_s3.py' in my project directory (e.g. /amazon_s3.py) and I've saved the Amazon

Re: mod_python/django problems

2007-08-03 Thread Aljosa Mohorovic
On Aug 3, 3:06 pm, David Reynolds <[EMAIL PROTECTED]> wrote: > We have around 30 and have noticed the problems you've mentioned.. anybody on list knows if there is any progress on this issue, will it be resolved? i know lighttpd is good but i still want to know if this issue with apache will be

Re: age in years calculation

2007-08-03 Thread Lucky B
how about surrounding the statement with a try and work the leap year to regular year case with the exception? On Aug 3, 10:16 am, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > Jonathan Buchanan wrote: > > > > > >http://toys.jacobian.org/presentations/2007/oscon/tutorial/ > > > Slide 14,

django app for managing sending email to users...

2007-08-03 Thread James Tauber
A number of sites I'm working on will optionally notify users of certain events via email. Think of the email you get from a social networking site when someone wants to add you as a friend. Or forum software that emails subscribers to a thread when there's been a new post. I also have

How do you set user permissions in test data?

2007-08-03 Thread Todd O'Bryan
I've been using fixtures to create test data, but how do I set user permissions that aren't brittle? If I use ./manage.py dumpdata it dumps the user_permissions as a list of ids of permissions the user has. The problem is, as I add more apps/permissions to my project, those ids are likely to

ANN: New alpha backend for MS Sql Server

2007-08-03 Thread mamcxyz
If want/need support for mssql, I hope this help. I submit a ticket with patchs for enable a new backend for sql server, so we can have a clean direction from the ado_mssql confusion of tickets, and have a single point for development. Is at http://code.djangoproject.com/ticket/5062. I'm

Re: Question about upload / FileField

2007-08-03 Thread !张沈鹏(电子科大 08年毕业)
In there , my filefield is required . Yes , you must upload a file . How can I reach this aim ? 2007/8/3, Thomas Guettler <[EMAIL PROTECTED]>: > > Am Freitag, 3. August 2007 15:34 schrieb ZhangshenPeng: > > Question 1: > > > > When I removed "blank=True" from FileField ,then use below method

Re: get object qs with certain generic relation

2007-08-03 Thread Bram - Smartelectronix
Jonathan Buchanan wrote: > class Flag(models.Model): > objects = FlagManager() > > Usage:: > > songs = Flag.objects.get_by_model_and_flag_type(Song, 'illegal') Thanks a lot Jonathan... I guess I should adding custom managers to all my classes containing generic relations! - bram

Re: Single sign-on with apache-tomcat

2007-08-03 Thread Landlord Bulfleet
Hi, I have to organize a single sign-on between a django and a tomcat (with Acegi Security) Any suggestions are appreciated :) Thanks in advance :) ** --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: age in years calculation

2007-08-03 Thread Bram - Smartelectronix
Jonathan Buchanan wrote: > > http://toys.jacobian.org/presentations/2007/oscon/tutorial/ > > Slide 14, unit tests too! :) >>> dob = date(1980,2,29) >>> dob.replace(year=2007) Traceback (most recent call last): File "", line 1, in ValueError: day is out of range for month it ain't a

Re: extending django.contrib.auth

2007-08-03 Thread Thejaswi Puthraya
> Is there a way I can add some attributes to the User model in > django.contrib.auth.models and also have those new attributes render > in admin? Probably you should have a look at Django-Registrationbetter to hack on this than directly on django.contrib.auth.models. See

Re: Question about upload / FileField

2007-08-03 Thread Thomas Guettler
Am Freitag, 3. August 2007 15:34 schrieb ZhangshenPeng: > Question 1: > > When I removed "blank=True" from FileField ,then use below method > to upload file , but no matter whether your choosed file , the from > valid will report error "This field is required." All newforms Fields habe a

(another) admin and edit_inline

2007-08-03 Thread Lic. José M. Rodriguez Bacallao
Why when I have a model edited inline other (for example, Model B is edited inline model A, admin is for model A) and model B have a DateTimeField field with auto_now_add = True (creation_date = DateTimeField(auto_now_add = True) ), when I save the model the second time, it raise this error:

Question about upload / FileField

2007-08-03 Thread ZhangshenPeng
Question 1: When I removed "blank=True" from FileField ,then use below method to upload file , but no matter whether your choosed file , the from valid will report error "This field is required." How can FileField work with newform without blank=True ? def file_fix_callback(field,

Re: Do I have to send shopping cart data to every template in my app?

2007-08-03 Thread Greg
Thanks for your help...I'm now able to create a custom tag. However, I now seem to have a another problem with custom tags. How do I send session information to each template. I can't use request.session['cart'] in my custom tag function because it doesn't have a request parameter. I always

Re: mod_python/django problems

2007-08-03 Thread David Reynolds
On 3 Aug 2007, at 1:58 pm, Aljosa Mohorovic wrote: On Aug 3, 1:47 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: On 03-Aug-07, at 4:46 PM, Aljosa Mohorovic wrote: is this an official bug? I havent heard of it - although i have a server with about 10 sites and have found one site once or

Re: mod_python/django problems

2007-08-03 Thread Matt Davies
We've got over 70 sites running on lighttpd, no problems at all. Why apache? On 03/08/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > > On 03-Aug-07, at 4:46 PM, Aljosa Mohorovic wrote: > > > on few blogs/web sites it is stated that > 30 django sites on one > > server running

Re: mod_python/django problems

2007-08-03 Thread Aljosa Mohorovic
On Aug 3, 1:47 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 03-Aug-07, at 4:46 PM, Aljosa Mohorovic wrote: > is this an official bug? I havent heard of it - although i have a > server with about 10 sites and have found one site once or twice i'm asking because i don't know. i'm not

Re: get object qs with certain generic relation

2007-08-03 Thread Jonathan Buchanan
> '%s.%s = %s.object_id' % > (backend.quote_name(Model._meta.db_table), > > backend.quote_name(Model._meta.pk.column), > rel_table) Aargh, mangled by Gmail - these lines should look like this (with the proper level of indentation

Re: get object qs with certain generic relation

2007-08-03 Thread Jonathan Buchanan
> I have a generic relation Flag, with a FlagType: > > class FlagType(models.Model): > name = models.CharField(maxlength=50) > description = models.TextField() > > class Flag(models.Model): > type = models.ForeignKey(FlagType) # type of flag > content_type =

Re: age in years calculation

2007-08-03 Thread Niels
Interesting. Would this work?? (now - birthday).days * 100 / 36524 Niels On Aug 3, 1:45 pm, "Jonathan Buchanan" <[EMAIL PROTECTED]> wrote: > On 8/3/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > > > > > > Hey Everyone, > > > does anyone have a good age in years calculation function

Re: extending django.contrib.auth

2007-08-03 Thread daev
You can create Profile model that can have all additional fields. Then connect it in settings.py to User model with AUTH_PROFILE_MODULE = "profiles.Profile". And you can get per user profile like this: user = User.objects.get( username = "foobar" ) profile = user.get_profile()

Re: get object qs with certain generic relation

2007-08-03 Thread [EMAIL PROTECTED]
On Aug 3, 1:31 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Aug 3, 12:54 pm, Bram - Smartelectronix <[EMAIL PROTECTED]> > wrote: > > > > > hello all, > > > I have a generic relation Flag, with a FlagType: > > > class FlagType(models.Model): > > name =

Re: mod_python/django problems

2007-08-03 Thread Kenneth Gonsalves
On 03-Aug-07, at 4:46 PM, Aljosa Mohorovic wrote: > on few blogs/web sites it is stated that > 30 django sites on one > server running apache/mod_python have some issues, like untraceable > errors and wrong site displaying for some domain. > any comments on this? is this an official bug? I

Re: age in years calculation

2007-08-03 Thread Jonathan Buchanan
On 8/3/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > Hey Everyone, > > > does anyone have a good age in years calculation function for usage with > datetime.date that returns the age in nr of years of a person? > > We were using: > > def get_age(self): > now = datetime.today() >

age in years calculation

2007-08-03 Thread Bram - Smartelectronix
Hey Everyone, does anyone have a good age in years calculation function for usage with datetime.date that returns the age in nr of years of a person? We were using: def get_age(self): now = datetime.today() birthday = datetime(now.year, self.birthday.month, self.birthday.day)

Re: get object qs with certain generic relation

2007-08-03 Thread [EMAIL PROTECTED]
On Aug 3, 12:54 pm, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > hello all, > > I have a generic relation Flag, with a FlagType: > > class FlagType(models.Model): > name = models.CharField(maxlength=50) > description = models.TextField() > > class Flag(models.Model): > type

mod_python/django problems

2007-08-03 Thread Aljosa Mohorovic
on few blogs/web sites it is stated that > 30 django sites on one server running apache/mod_python have some issues, like untraceable errors and wrong site displaying for some domain. any comments on this? i have many small php sites that will eventually became django sites, how should i deploy?

Re: Internationalization and accents

2007-08-03 Thread Jonas
> Also, you should be using a recent SVN checkout for this to work. It does work with he latest development version. Thank you! Jonas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

extending django.contrib.auth

2007-08-03 Thread ocgstyles
Is there a way I can add some attributes to the User model in django.contrib.auth.models and also have those new attributes render in admin? I figure I could just edit the django.contrib.auth.models and add the attributes manually, but that won't last persist through future upgrades.

get object qs with certain generic relation

2007-08-03 Thread Bram - Smartelectronix
hello all, I have a generic relation Flag, with a FlagType: class FlagType(models.Model): name = models.CharField(maxlength=50) description = models.TextField() class Flag(models.Model): type = models.ForeignKey(FlagType) # type of flag content_type =

Re: website template compatible with django

2007-08-03 Thread Kenneth Gonsalves
On 03-Aug-07, at 2:44 PM, Chris Hoeppner wrote: > Oh and please don't call Template Monster "professional"... Please... thank god they dont offer free django templates -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/

Re: website template compatible with django

2007-08-03 Thread Chris Hoeppner
Oh and please don't call Template Monster "professional"... Please... 2007/8/3, Chris Hoeppner <[EMAIL PROTECTED]>: > Though you would still need to adapt them to be used with Django. > IMHO, there's not much sense in publishing "Django templates" since > every app is completely different, and

Re: website template compatible with django

2007-08-03 Thread Chris Hoeppner
Though you would still need to adapt them to be used with Django. IMHO, there's not much sense in publishing "Django templates" since every app is completely different, and this kills the "plug-and-play-ability" of any template. 2007/8/3, Kenneth Gonsalves <[EMAIL PROTECTED]>: > > > On

Re: Job Fair F/OSS project

2007-08-03 Thread Chris Hoeppner
What kind of volunteers do are you looking for? What kind of tasks are you looking to resolve? If I could have some more details (maybe have a look at the proposed timeline) I'd be in :) 2007/8/3, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > I'm looking for some volunteers for a new open source

Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread koenb
There already is a ticket: #4783. Just needs volunteers to do the writing... Koen On 3 aug, 10:41, james_027 <[EMAIL PROTECTED]> wrote: > hi, > > On Aug 3, 4:32 pm, koenb <[EMAIL PROTECTED]> wrote: > > > My guess is you are interfering with your admin_media (look at the > > admin_media_prefix

Re: Newforms w/ *dynamic* ChoiceField choices?

2007-08-03 Thread Jonathan Buchanan
> Newforms has a spiffy way to dynamically set the "initial" values of > fields, in the view code when the Form is constructed. > choosecolorform = ChooseColorForm(initial={'color': 'black'}) > > I was hoping it would be just as easy to dynamically define the > choices available in a

Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027
hi Kai, > If you do not use it, no. > If I use it, how does it affect then? thanks james --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027
hi, On Aug 3, 4:32 pm, koenb <[EMAIL PROTECTED]> wrote: > My guess is you are interfering with your admin_media (look at the > admin_media_prefix setting). > Try using something like r'^sitemedia/... and src="/sitemedia/...". > Thanks koen, that did it. I think it could be nice if it was

Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread koenb
My guess is you are interfering with your admin_media (look at the admin_media_prefix setting). Try using something like r'^sitemedia/... and src="/sitemedia/...". Koen On 3 aug, 09:16, james_027 <[EMAIL PROTECTED]> wrote: > hi, > > I already did the > > (r'^media/(?P.*)$',

Re: OR a Q object - Problem with ManyToMany relationships?

2007-08-03 Thread LaundroMat
Driving to work this morning I was thinking of how I should have had a look at the generated SQL statement (which I can't do now). I think you are right, it's the only way the exclusion could have happened. Would you have an idea of how to prevent this, preferrably without having to write the

Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread Kai Kuehne
Hi, On 8/3/07, james_027 <[EMAIL PROTECTED]> wrote: > does it affect the django.views.static.serve? If you do not use it, no. Greetings Kai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027
hi, are this settings used when running under development mode? MEDIA_ROOT MEDIA_URL does it affect the django.views.static.serve? thanks james --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Newforms - passing form data in sessions - Trouble with ForeignKey

2007-08-03 Thread MichaelMartinides
Hi Rajesh, Thanks for your answer. Basically, I have two forms (derived from models) that I validate on two pages. On the third page I would like to present the two datasets and save the models when the user validates them by clicking submit. One model (order) has a foreignkey to the other

help serving static files (css, images, pdf, js)

2007-08-03 Thread james_027
hi, I already did the (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root':'d:/private/james/documents/django/ksk/media'}), in my urls.py and in my template i have something like this but why is it the image still don't appear? Thanks james

Re: Django and mod_proxy

2007-08-03 Thread Matt Davies
Hi Przemek I do, but I hand the request from apache to Lighttpd, which in it's conf file handles the serving of docs. I'm not sure but I think you need something extra in apche to tell it where the static content is. On 03/08/07, Przemek Gawronski <[EMAIL PROTECTED]> wrote: > > > Hi, I'm

Re: Newforms w/ *dynamic* ChoiceField choices?

2007-08-03 Thread Thomas Guettler
Am Freitag, 3. August 2007 00:19 schrieb rskm1: > Newforms has a spiffy way to dynamically set the "initial" values of > fields, in the view code when the Form is constructed. > choosecolorform = ChooseColorForm(initial={'color': 'black'}) I think you only can set initial to a value, not to a

Re: Something like a mini Crystal Reports with Django

2007-08-03 Thread Matt Davies
Ben, I'd be interested in looking at that application. Need someone to help with testing? On 03/08/07, Ben Ford <[EMAIL PROTECTED]> wrote: > > I'm working on a django app at the moment that allows you to define and > save reports. It has a method similar to templatetags for loading user >

Re: Something like a mini Crystal Reports with Django

2007-08-03 Thread Ben Ford
I'm working on a django app at the moment that allows you to define and save reports. It has a method similar to templatetags for loading user defined functions to add to the reports too. As it stands you can build and save these reports with a web front end, and download the results in CSV. I

Re: Queryset of instances bound to particular ForeignKey

2007-08-03 Thread James Bennett
On 8/3/07, Collin Grady <[EMAIL PROTECTED]> wrote: > >>> B.objects.filter(a__isnull=False) > [, ] And as pointed out in our IRC discussion, that needs a distinct() slapped on the end to weed out duplicate results ;) -- "Bureaucrat Conrad, you are technically correct -- the best kind of

Re: Queryset of instances bound to particular ForeignKey

2007-08-03 Thread Collin Grady
I feel silly for not trying this earlier, but it appears to work :) >>> B.objects.filter(a__isnull=False) [, ] Models used for this test: http://dpaste.com/15931/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Queryset of instances bound to particular ForeignKey

2007-08-03 Thread James Bennett
On 8/3/07, James Bennett <[EMAIL PROTECTED]> wrote: > Foo.objects.extra(where=['id IN (SELECT %s FROM %s)' % Bar._meta.db_table]) Should have been: > Foo.objects.extra(where=['id IN (SELECT foo_id FROM %s)' % > Bar._meta.db_table]) (sent before I realized I'd decided not to use quote_name()

Re: Queryset of instances bound to particular ForeignKey

2007-08-03 Thread James Bennett
On 8/3/07, Collin Grady <[EMAIL PROTECTED]> wrote: > He wants every B that has an A fkeyed to it. > > In other words, every instance of B where b.a_set.count() > 0 In which case what he wants is probably something like ModelB.objects.filter(id__in=[o.id for o in ModelA.objects.all()]) Which is