Geospatial queries using F() object... Is this even possible?

2011-08-25 Thread Info Cascade
Hi -- I'm trying to figure out how to do a geospatial query that references a model field in the filter. class Article(geomodels.Model): point = PointField(...) radius = IntegerField(...) query_point = Point (...) Articles.objects.filter(point__distance_lt=(query_point, F('radius')))

Problem with dumpdata and loaddata in python format

2010-08-11 Thread Info Cascade
Hi -- I'm expecting python manage.py dumpdata --format=python ... to dump data, but it does not. I get "Error: Unknown serialization format: python" instead. Specifying json or xml does work, however. Same for loaddata. "Problem installing fixture 'fixtures/bme_auth': python is not a known

M2M Manager -- how to get primary key of join table?

2010-04-22 Thread Info Cascade
Hi -- I have two models with a m2m relationship, and I need to get the value of the primary key of the join table. To use the example from the book: > from django.db import models > > class Publication(models.Model): > title = models.CharField(max_length=30) > > def __unicode__(self): >

Help! Need to do full-text query on multiple tables

2010-01-13 Thread Info Cascade
Hi, Need some help,here! I posted this a while ago and didn't get any response that was helpful. I still need to resolve it, and someone who understands the problem surely can point me in the right direction. Do I need a custom manager for a sql UNION query, and if so, what is the best

Re: Apache Environment Variables

2009-12-17 Thread Info Cascade
Dan, This works for me -- using mod_python. VirtualHost defininition: > SetEnv VIRTUAL_HOST_NAME dev.hostname.com > SetEnv DATABASE_NAME dbname settings.py: > VIRTUAL_HOST_NAME = os.environ.get('VIRTUAL_HOST_NAME') > DATABASE_NAME = os.environ.get('DATABASE_NAME') Liam Dashdrum wrote: > I'm

Re: Initial values and unbound forms (apparently a bug?)

2009-12-08 Thread Info Cascade
Hi, Manu, Thanks for writing. I tried what you suggested, and the forms were displayed exactly as I wanted. However, when I tried to submit the form, it triggered validation errors for all the fields that were left blank. So, the behavior is not quite what I want. I'm guessing that setting the

Re: Pydev + Django + Ubuntu 9.10

2009-12-07 Thread Info Cascade
ou suggest me Posgresql/PostGIS. I don't have > any problems with setting up the database, just with setting up Pydev/ > Eclipse correctly. > Any further suggestions? > > Regards, > Kai > > > On Dec 6, 12:08 am, Info Cascade <informationcasc...@gmail.com> wr

Re: Pydev + Django + Ubuntu 9.10

2009-12-05 Thread Info Cascade
Turkan, Perhaps this will help. I just have done this (PostGIS/Eclipse/Pydev/Django on Ubuntu 9.10) and it's working great! After having problems because I had installed Postgres 8.4, I found the script below, on the net somewhere. Modify, as appropriate, if you don't need GIS. You may also

Initial values and unbound forms

2009-12-03 Thread Info Cascade
Hi -- I am trying to set some reasonable defaults as initial field values in a formset. Here is what I'm doing section_form_initial = { 'audio_publisher':default_publisher, 'audio_license':default_license, 'text_format':default_text_format } If I

Re: Help with Custom Manager and UNION query?

2009-12-01 Thread Info Cascade
w they stack up > > On Nov 30, 2:45 pm, Info Cascade <informationcasc...@gmail.com> wrote: > >> Hi -- >> >> I've been programming with Django about a year, and really like it, but >> I've run into something that I can't quite solve on my own. >> I think

Help with Custom Manager and UNION query?

2009-11-30 Thread Info Cascade
Hi -- I've been programming with Django about a year, and really like it, but I've run into something that I can't quite solve on my own. I think someone else may be able to offer the answer, or at least a hint to send me in the right direction. I have two tables I want to search in

Need help with Query: Q Objects and .extra()

2009-11-13 Thread Info Cascade
Hi -- I need help with a query! Currently using .extra to do full text query on the article.title field. art_list = Article.objects.filter(status__status='PUBLISHED') art_list = art_list.extra( where=['title_tsv @@ plainto_tsquery(%s)'], params=[term]) That works great. I want to add the

Django Developers Wanted

2009-04-01 Thread Info Cascade
Hi, Joe, We're looking for a Django developer, and I happened upon your profile at DjangoGigs. If this looks like it might be of interest, please contact me for more information. Best, Liam Kirsher 415.456.4420 -- Hi -- This will probably be of most interest to Django developers in the San

FormSet with non input-element data possible?

2009-02-09 Thread Info Cascade
Hi -- I'm creating a FormSet and want to include some data in the form output that is not an html input element. Some of the data I pass to the FormSet, which gets passed to the form, I just want to display, I don't want to put it into an HTML input element. I want it to be available in the

Django Developers Wanted

2009-01-23 Thread Info Cascade
Hi -- This will probably be of most interest to Django developers in the San Francisco Bay Area, but the company is open to hearing from anyone who might be interested. This is a new product already getting great press, and a fun development team. Feel free to contact me if you have any

Getting SQL from QuerySet

2008-12-30 Thread Info Cascade
Hi -- I am getting intermittent errors on certain database queries on our production server. I am having a hard time duplicating them (most of the time they run okay, only sometimes on the production server am I receiving exception messages), so I want to log the SQL query itself and see what it

Postgres Full-text search -- is it possible?

2008-12-15 Thread Info Cascade
Hi -- I'm wanting to improve searches by using full-text searching. The documentation says: > > > search¶ > > > A boolean full-text search, taking advantage of full-text indexing. > This is like contains but is

Re: Querying across many-to-many relations

2008-12-14 Thread Info Cascade
k wrote: > (You forgot to include a title. I nearly nuked this as spam, by > accident. So I've thrown in a title for fun.) > > On Sun, 2008-12-14 at 19:50 -0800, Info Cascade wrote: > >> Hi -- >> >> I have a question about many-to-many relationships and how to

Re: Querying across many-to-many relations

2008-12-14 Thread Info Cascade
pam, by > accident. So I've thrown in a title for fun.) > > On Sun, 2008-12-14 at 19:50 -0800, Info Cascade wrote: > >> Hi -- >> >> I have a question about many-to-many relationships and how to reference >> a related object field using Django syntax via the Manager cl

[no subject]

2008-12-14 Thread Info Cascade
Hi -- I have a question about many-to-many relationships and how to reference a related object field using Django syntax via the Manager class. I think this is probably pretty simple and just reflects my inexperience working with Django (which overall I am enjoying, btw.) Anyway, the models look

Re: How to import DoesNotExist exception ???

2008-12-08 Thread Info Cascade
DoesNotExist. > > On Dec 8, 2:52 pm, Info Cascade <[EMAIL PROTECTED]> wrote: > >> How do I import the DoesNotExist exception? >> >> This doesn't seem to work:> from django.db.models.query import DoesNotExist >> >>> try: >>> ta

Re: GeoDjango in Ubuntu 8.10, Segmentation Fault

2008-12-01 Thread Info Cascade
FWIW -- I got this working in CentOS5.2 by removing the default (yum installed) version of apache, and compiling the latest version, 2.2.10. While I was at it, I compiled the latest version of mod_python. That was all it took, and now, no more segmentation violations. Thanks, Liam Justin Bronn

Re: GeoDjango in Ubuntu 8.10, Segmentation Fault

2008-11-24 Thread Info Cascade
I reported a similar problem in October. Since then, I have tested on a new server and am experiencing the same problem. This one is on an CentOS 5.2 EC2 machine configured as below... I wonder if noting the workaround discovered by GRoby will give the developers any clues as to what is going

Re: How to get comment_count in view?

2008-11-04 Thread Info Cascade
I was just asking myself a similar question. I want to know the total result count of a query but only return a subset of the query. Articles.objects.filter(somefield__contains='some query')[start:start+num_rows] I understand the slice creates a LIMIT in the database query. But I also need the

S3Storage, FileField -- default_storage.exists() has unwanted side-effects

2008-10-30 Thread Info Cascade
I have a model that has a FileField storage field. The default_storage system is S3Storage. I noticed that I was getting unusual results when I simply tried to verify whether the file existed on disk using the default_storage.exists() method. If I call it with the FileField object, it causes

Re: GeoDjango problem -- server hangs on GEOSGeometry calls

2008-10-25 Thread Info Cascade
Justin, More, different information -- On further investigation, I've discovered that it's actually hanging when I try to do a search: > bbpoly = GEOSGeometry('POLYGON(( 38.302807 -122.867744, > 38.482792 -122.867744, 38.482792 -122.633660, 38.302807 -122.633660, > 38.302807

Re: GeoDjango problem -- server hangs on GEOSGeometry calls

2008-10-24 Thread Info Cascade
I've got it set on Permissive... I checked that before... Damn! Just checked the audit log and it's denying when I access the app. Even in Permissive mode. WTF? Okay, then. I'll disable it completely. I am so sick of selinux! ... Okay, disabled in /etc/selinux/config, rebooted and now... no

Re: GeoDjango problem -- server hangs on GEOSGeometry calls

2008-10-24 Thread Info Cascade
Hi, Justin, Thanks SO much for responding! We met at the WhereCamp meeting, you probably don't remember... Thanks for looking at this. Liam Here's the info... Server version: Apache/2.2.3 Server built: Jan 15 2008 20:33:41 With mod_python Python 2.4.3 ServerName rocket.domain.com

S3Storage, Models, and Files...is this obvious?

2008-10-21 Thread Info Cascade
Hi -- Again, I'm new to Django (and for that matter, Python). I am using the S3Storage module (and currently set default_storage to S3Storage). My model has a FileField which should store the file using S3 (because S3Storage is the default). I am creating an mp3 file using Popen, which is

Timing is everything

2008-10-21 Thread Info Cascade
Hey, I'm new to Django. Be nice! Is there some simple way to time the whole Django process, request to response? PHP has something like that. I'd like to include that information in the response. Any ideas? Liam --~--~-~--~~~---~--~~ You received this message

Whether to use Model Manager class for DAO

2008-10-15 Thread Info Cascade
Hi -- I am new to Django programming, and need a few tips on how to accomplish something. What I need is to have a model that provides a data access layer to multiple databases. Something like what I have pseudocoded below. The idea is to just use the DataAccess layer (class) to access various