Re: database query help

2006-05-03 Thread Dave St.Germain
oops.  My mistake.  I should've looked up the db-api docs before replying...On 5/3/06, Adrian Holovaty <[EMAIL PROTECTED]
> wrote:On 5/3/06, tsnyder <[EMAIL PROTECTED]
> wrote:> I think I have missed something in the documentation, and I am hoping someone> can help me.  What is the django equivalent of doing something like this:>> select * from event where semester_id = 1 and category_id = 2
>> Where the event table is related to two other tables (semester and category).Hi Tamara,If you're using the Django development version, try this:Event.objects.filter(semester__id__exact=1, category__id__exact=2)
If you're using Django 0.91 or earlier, try this:events.get_list(semester__id__exact=1, category__id__exact=2)Adrian--Adrian Holovatyholovaty.com
 | djangoproject.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Re: database query help

2006-05-03 Thread Dave St.Germain
I think this is what you're looking for:Event.objects.filter(semester__id=1,category__id=2)(note the two underscores)On 5/3/06, tsnyder <
[EMAIL PROTECTED]> wrote:Hi all,I think I have missed something in the documentation, and I am hoping someone
can help me.  What is the django equivalent of doing something like this:select * from event where semester_id = 1 and category_id = 2Where the event table is related to two other tables (semester and category).
Thanks, and I'm sorry for asking what is probably a very obvious question.Tamara

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Re: Different versions of Django - apache virtual hosts

2006-04-28 Thread Dave St.Germain
You may have to set the PythonInterpreter argument:PythonInterpreter "uniquename"for each vhostOn 4/28/06, tomass <
[EMAIL PROTECTED]> wrote:Hi Folks,Just wondering how I configure an apache virtual host to use a
different version of Django. I've installed the magic-removal branchand have added the following to my virtual host config file, but I'mstill getting an error message which indicates that it's using the 0.91
version of Django.ServerName example.comDocumentRoot /var/www/html/example/htmlSetEnv PYTHONPATH /home/mthaddon/django/magic-removal
SetHandler python-programPythonHandler django.core.handlers.modpythonSetEnv DJANGO_SETTINGS_MODULE opscenter.settingsPythonDebug On
SetEnv PYTHONPATH /home/mthaddon/django/magic-removalSetHandler python-programPythonHandler django.core.handlers.modpythonSetEnv DJANGO_SETTINGS_MODULE opscenter.settings
PythonDebug OnThanks, Tom

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Re: fastcgi question

2006-04-21 Thread Dave St.Germain
You can configure FastCGI to start up a set number of processes when apache starts and keep them running.  Something like this in your httpd.conf should suffice:FastCgiConfig -idle-timeout 90 -restart -minProcesses 5
FastCgiServer /path/to/django.fcgi -processes 5On 4/21/06, tsnyder <[EMAIL PROTECTED]> wrote:
I am extremely new to all of this, so if my question is stupid I'm sorry.  Icouldn't find the answer afterdoing some searches.  I suspect that is because the answer is obvious, and Iapologize if it is.
If I run django as fastcgi with apache, then, as I understand it, there is afastcgi program runningcontinuously, connected to my django site, and apache just forwards the pagerequest to the fastcgiprogram.  It looks like *I* have to manually launch this program.  Is that
correct?  How do I keep it running- or relaunch it when it goes down?  And does it time out and quit after awhile?  In some testing yesterdayon my powerbook, it looked as if the fastcgi program just died a couple of
hours after I started it.  I reallydon't want to have to start fastcgi programs manually several times a day.I am looking at using django to create several web applications.  These appswill have a fairly specific
audience, and I don't expect more than a few hundred hits a day (maybe up to1000 or 1500 a day totalfor all apps once all are running).  Can apache 1.3 and fastcgi work as asolution for me?Thanks!
Tamara

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Re: problem with threaded apache

2006-04-21 Thread Dave St.Germain
I've been running django (trunk and M-R) on apache prefork with no problems.  I recently switched to the worker MPM, and so far, everything seems to work fine (with better memory usage, I might add).  I did have a problem on a separate installation, however, related to memcache.  I think there may be a deadlock problem when using memcache and the worker MPM, but I haven't investigated it much yet.
But I can confirm that this combination works for me:FreeBSD 6.0Apache 2.0.55 with worker mpmpython 2.4.3mod_python 3.2.8psycopg 1.1.21postgresql 8.1.3
On 4/21/06, Richie Hindle <[EMAIL PROTECTED]> wrote:
[Jacob]> I'd suggest switching to the "prefork" MPM for ApacheFor what it's worth, I think this advice should be in the documentation.The documentation says "Apache with mod_python currently is the preferred
setup for using Django on a production server" but it doesn't explainwhich MPM.--Richie Hindle[EMAIL PROTECTED]
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Re: Ecommerce & Django

2006-04-13 Thread Dave St.Germain
For what it's worth, I've written a python module that works with Authorize.net that I could contribute (after properly opensource-itizing...).On 4/13/06, 
arthur debert <[EMAIL PROTECTED]> wrote:
"Setup a free python project on python-hosting.com"+1 on this one. when getting started we better focus on the codingright away, and python hosting's capabilities (svn + trac ) setup with
no fuss will be very helpfull (it seems)." Any brilliant ideas?" not really...djell, djuy , djart

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


ManyToMany with related_name?

2006-04-12 Thread Dave St.Germain
I'm trying to create a model that relates back to itself with a ManyToManyField.  Here's my model:class PressRun(models.Model):    starttime = models.DateTimeField(db_index=True)    endtime = models.DateTimeField
(validator_list=[endAfterStartValidator])    name = models.CharField(maxlength=100,blank=True)    recurringitem = models.ForeignKey(RecurringPressRun,blank=True,null=True)    edition = models.IntegerField(choices=EDITION_CHOICES,blank=True,null=True)
    press_id = models.IntegerField(choices=PRESS_CHOICES,blank=True,default=1)    insert_into = models.ManyToManyField('self',  null=True,  blank=True,  related_name='insert')
The problem is that the model doesn't seem to use the related_name option.  PressRun objects have an insert_into property, but no insert property.  I'm actually trying to say that the result of a PressRun can be "inserted" into another PressRun, but I don't want to make a separate object (like PressRunInsert or something).  I'd like to use a simple ManyToMany, but the objects don't have a distinction between "inserted into" and "insert of".  
Does that make sense?Dave

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Re: where is the meta?

2006-04-12 Thread Dave St.Germain
models.TABULAR should workOn 4/12/06, yi huang <[EMAIL PROTECTED]> wrote:
today i update the django magic-removal svn,and install new versioni read new db-api.html , and see models.ForeignKey(Poll, edit_inline=meta.TABULAR

but where to import meta module.and the old code "models.TABULAR" is wrong now.
-- http://codeplayer.blogbus.com/



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Re: Is select_related broken in magic removal?

2006-04-11 Thread Dave St.Germain
Ah, it was user-error.  I was bulk-inserting some data with predefined foreign key ids, but I forgot to create the table that those foreign keys reference, and I didn't set "null=True" in the model.  So, the select_related was joining a table that had no records -- thus returning an empty list when I queried for them.
I should've known it was MY dumb mistake rather than Django's!DaveOn 4/10/06, Adrian Holovaty <[EMAIL PROTECTED]
> wrote:On 4/10/06, Dave St.Germain <
[EMAIL PROTECTED]> wrote:> ...Or am I doing something wrong?> In django-trunk, select_related seems to work, but in magic-removal, I get> an empty list.  It looks like the QuerySet isn't generating the joins for
> related objects correctly.  I'm still digging into this one, but is this a> known issue?I'm not aware of any problems with select_related...Could you pastethe exact code you're using?Adrian
--Adrian Holovatyholovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Is select_related broken in magic removal?

2006-04-10 Thread Dave St.Germain
...Or am I doing something wrong?In django-trunk, select_related seems to work, but in magic-removal, I get an empty list.  It looks like the QuerySet isn't generating the joins for related objects correctly.  I'm still digging into this one, but is this a known issue?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---