Re: apache prefork or worker? other settings

2008-03-03 Thread Corey Oordt
Aljosa, The docs are really good. ( http://www.djangoproject.com/documentation/modpython/ ) I can attest that you should definitely use prefork instead of worker. I was getting random crashes on our server until I realized that one of my admins installed worker. Switching to prefork

Re: Deploying django framework with site

2008-02-08 Thread Corey Oordt
Tim, The django module just needs to be on the python path, which you can set in the mod_python configuration. So you could do something like: /My Site /myproject /site-packages /django Shouldn't be to difficult as long as you put both /My Site/myproject

Re: Unicode error

2008-02-06 Thread Corey Oordt
Kristian, I had a similar problem when I needed to send some ASCII emails. I have a snippet at does a translation of unicode characters to close ASCII approximations if it is helpful: http://www.djangosnippets.org/snippets/588/ Corey On Feb 5, 2008, at 3:48 PM, Kristian Øllegaard wrote:

Re: how to handle django static files(css js etc) properly.the views.static.serve or apache's SetHandler None just too eerie

2008-01-23 Thread Corey Oordt
I recommend this approach because it works seamlessly when transferring between production and development: 1. Put your static files in the repository (assuming you are using one) 2. On the production server, add these lines to the site config so this doesn't get used except on

Re: CSS & Media files

2008-01-16 Thread Corey Oordt
mOne, I use a system that uses the main urls.py and a change on the apache site config. This allows me to have all the files in one repository and see it when I'm using the development server, but use apache to deliver the files when on the production server. in urls.py you put in: (

Re: Street address normalisation

2007-11-29 Thread Corey Oordt
I ported part of the Geo Street Address from the perl module: address_regex.py from geocode.address_dicts import * STREET_TYPE_REGEX = "|".join(STREET_TYPES.keys()) + "|" + "|".join(STREET_TYPES.values()) STATE_REGEX = "|".join(STATE_CODES.values()) DIRECTIONS_REGEX =

Anyone attending the Web 2.0 Conference?

2007-04-10 Thread Corey Oordt
I see that Adrian is going to be at Web 2.0 next week. Anyone else going to be in town for a Birds of a Feather? Thanks, Corey --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Left Joins / Inheritance / Plugins ...whatever...

2007-03-30 Thread Corey Oordt
Mike, What comes to mind is an intermediary table, a Many-to_many table. Design 1: This design depends on a separate Model that lists the available plugins, but would require a manual join of the plugin_table_id to the appropriate model/table. The plugin model tells you which type of link

Re: Is this bug in Django

2007-01-22 Thread Corey Oordt
What exact command did you type? On Jan 22, 2007, at 5:44 AM, [EMAIL PROTECTED] wrote: > > Traceback (most recent call last): > File "manage.py", line 11, in ? > execute_manager(settings) > File > "/usr/local/lib/python2.4/site-packages/django/core/management.py", > line 1447, in

Re: Ho do your Django applications fit in your projects?

2007-01-16 Thread Corey Oordt
Hello, I've found that each application should be specific in its functionality. How you organize it really depends on the type of project. A simple blog might only be one application. Our intranet site has 7, including a settings.py file, if necessary. I think how coupled or decoupled

Re: Manually setting an ImageField gives a SQL error

2006-10-12 Thread Corey Oordt
Thanks for the tip, I am using os.path.splitext() ! I think somehow the problem lies with psycopg and it's "auto-quoting" feature. I'm not sure how it figures out what needs to be quoted and what doesn't. Thanks for the help, RajeshD! Corey On Oct 12, 2006, at 4:07 PM, RajeshD wrote: >

Re: long-running process. how to do it?

2006-10-06 Thread Corey Oordt
You, know I just found that utility last week. As far as just doing an os.spawn*, my recollection is that if your process ends, the spawned process ends, even if you are not waiting for it to return. In the case with a web server, as soon as you return from your view, the spawned process

Re: long-running process. how to do it?

2006-10-05 Thread Corey Oordt
I wrote a daemonize method that can be called by the view to spawn a new process that executes your code.It is part of this thread:http://groups.google.com/group/django-users/browse_frm/thread/b36f4ca10a424161/c5131410e5d548b1?lnk=gst=daemonize=2#c5131410e5d548b1I'm happy to give you any other

Re: HTTP response-code for missing querystring?

2006-09-24 Thread Corey Oordt
, gabor wrote: > > Corey Oordt wrote: >> I'm not sure I can appreciate why you would require a URL to have a >> query string. It seems to go against the anti-crufty URLs that Django >> is trying to avoid. >> >> Query strings, if I understand them correctly are

Re: How to correct this error?

2006-09-06 Thread Corey Oordt
Believe it or not, latin1_swedish_ci is a default collation for MySQL. I recommend using PHPMyAdmin. It is the easiest way to see the collations and change the collations. (but you have to use PHP :( ) You can use the MySQL Administrator GUI but it is a pain as you have to do a lot more

Re: How to correct this error?

2006-09-05 Thread Corey Oordt
You can change to collation of your MySQL tables by table and by field. If you do it by table, all new fields are of that collation. If you already have fields of a collation, you will have to change all of them. I used PHPMyAdmin to do it as the interface is nice and simple. You

Re: Advanced Admin Customization

2006-09-05 Thread Corey Oordt
mthorley: I think you just need to override the save() method of your model. You can do all the processing you need before it's saved. Corey On Sep 5, 2006, at 10:21 AM, mthorley wrote: > > Thanks for the tip Nate! > > Does any one know what method receives the data from the form when it >

Re: Directional Many-to-many

2006-08-29 Thread Corey Oordt
Take a look at: http://www.djangoproject.com/documentation/models/m2m_and_m2o/CoreyOn Aug 29, 2006, at 12:15 PM, Siah wrote:Hello,Given this model:class Person(models.Model):    name = models.CharField(maxlength=200)    children = models.ManyToManyField('self')I can do:   

Re: Creating new apps

2006-08-29 Thread Corey Oordt
Charles,I've always seen a Project as a Site. Although there are situations that that may not be true, for most of us, it probably is.I've seen an App as a grouping of functionality. Examples would be Blog, Forums, News, Gallery, etc.Good design practices should keep as much internal within each

Re: Sending an html email

2006-08-27 Thread Corey Oordt
I've never done it before, but here are some places to look:http://code.djangoproject.com/ticket/1541http://www.rossp.org/blog/2006/jul/11/sending-e-mails-templates/CoreyOn Aug 26, 2006, at 8:59 PM, The Rem wrote:Hi,I am using the template to build the email content.  I included linksin it but the

Re: generic views for ajax ?

2006-08-26 Thread Corey Oordt
Dirk, I think that it's a great option. It doesn't advocate a specific framework or method even. AJAX views will be very similar to html views and I agree that having some generic views for AJAX is a great addition to the Django community, even if it doesn't get added to the core. Corey

Re: Multiple rows in a form

2006-08-22 Thread Corey Oordt
Stewart:Take a look at http://www.djangoproject.com/documentation/forms/ for more on creating forms, and simplifying the process.You will need to have to figure out how you want to handle the item listings. You will either have to have a static set of items or use some fancy _javascript_/DHTML to

Re: limit_choices_to Users in a Group

2006-08-21 Thread Corey Oordt
I think you need to include django.core.exceptions And I think that the exception is ObjectDoesNotExist Corey On Aug 21, 2006, at 4:24 PM, Waylan Limberg wrote: > > I figured this out, thanks to a suggestion in another thread. It seems > I was misunderstanding something about how

Re: Process forking issues

2006-08-21 Thread Corey Oordt
I wrote some code that might help you out: it in the thread:http://groups.google.com/group/django-users/browse_frm/thread/b36f4ca10a424161/c5131410e5d548b1Depending on how you spawn a process, it can either wait for each, or become a child process.Calling the daemonize method with the appropriate

Re: Process forking issues

2006-08-17 Thread Corey Oordt
I think I had this problem, at least it feels very familiar, and I do some process forking. I think that the problem is using the same connection more than once. I think that the cursor is being closed and then being used again. I took the habit of creating a new cursor and specifically

Re: showing future events only?

2006-08-16 Thread Corey Oordt
I thought a change was made in the generic date views to show only future events. It is the allow_future parameter, I believe. Corey On Aug 16, 2006, at 1:38 PM, [EMAIL PROTECTED] wrote: > > I've got an app for user events, using the generic list view to > display > them. So far , so

Re: OT: Sort messages by thread in OS X Mail

2006-08-16 Thread Corey Oordt
I was sorting by subject and it was doing an ok job. Thanks for pointing this out. I always feel stupid when there is such an obvious feature that I never noticed... Corey On Aug 15, 2006, at 10:04 PM, Sean Schertell wrote: > > Hey guys, > > I hope I'm not the only schmuck to arrive so

Re: geographic targeting with django

2006-08-15 Thread Corey Oordt
Ian,Try: http://www.maxmind.com/app/geolitecityCoreyOn Aug 15, 2006, at 8:17 PM, Ian Holsman wrote:Hi. does anyone know of a python module/interface to allow me to determine what state a given IP# is in? (Open source preferably) -- Ian Holsman [EMAIL PROTECTED] http://VC-chat.com It's what the

Re: How do I store project in subversion?

2006-08-15 Thread Corey Oordt
Don't store your .pyc in the repository. Create a settings.default.py and store it in the repository. Each user can then maintain slightly different settings On Aug 15, 2006, at 6:50 PM, alex kessinger wrote: > > I want to thank you for all your anwsers it has been very helpfull. I > also

Re: How do I store project in subversion?

2006-08-15 Thread Corey Oordt
I'm probably not the best person to be answering this, but I do have an internal subversion repository.If you don't have a working subversion server, follow the instructions at: http://svnbook.red-bean.com/nightly/en/svn.serverconfig.httpd.html(Since it's an internal machine, I just use basic

Re: Where to store large SQL queries code

2006-08-11 Thread Corey Oordt
One idea is to create a package that would contain files of your queries. Each file could just be have an assignment : QUERY = """ """ You could then import them, like : from queries import update_this and access it by update_this.QUERY Corey On Aug 11, 2006, at 3:05 PM, Maciej Bliziński

Re: How to log ALL queries

2006-08-11 Thread Corey Oordt
David,Not sure if this helps, but the only way I found (using postgresql) was to turn on query logging in postgresql. Then you truly see everything that is passed to the database.I'm not familiar with Oracle at all, but I'm sure it has a way to do that.Corey OordtOn Aug 11, 2006, at 8:38 AM,

Re: show many2many data as comma-separated-text. fast/optimal solution?

2006-08-07 Thread Corey Oordt
I may be showing my ignorance of Django and python here but: in MySQL there is an aggregate function GROUP_CONCAT that will do precisely what you want. There is a PostgreSQL library that adds the functionality as well. I'm still getting used to the ORM is Django, so I'm not sure how you

Re: Code to spawn a new, independent process

2006-08-06 Thread Corey Oordt
Martina, Mostly because I'm new to python and in my research no one mentioned it! You are right, this does look like a better fit. Live and learn! Corey On Aug 6, 2006, at 12:40 PM, oefe wrote: > > > Corey wrote: >> Hey everyone, >> >> I've seen references and questions in previous posts

Re: Ajax and Django example application

2006-08-04 Thread Corey Oordt
Istvan, Thanks for the code. I can't wait to dive into it. Corey On Aug 4, 2006, at 12:12 AM, Istvan Albert wrote: > > Hello All, > > For those interested here is an AJAX based demo application using > django, developed with two different javascript libraries: Prototype > and with MochiKit >

Re: get many from multiple levels of one-to-many relations

2006-07-19 Thread Corey Oordt
Thanks, Andy. I'll give that a try! Corey On Jul 18, 2006, at 9:35 PM, Andrew wrote: > > Here's how I did it for a similar situation I had. > > class MyCategory(models.Model): > category = models.CharField(maxlength=50) > parent_category = models.ForeignKey('self', blank=True, >

Re: 'got multiple values for keyword argument' error

2006-06-22 Thread Corey Oordt
Man I hate silly errors! Thanks so much Rajesh! (It happens to be my first view, the generic views got me spoiled!) Corey On Jun 22, 2006, at 9:10 PM, [EMAIL PROTECTED] wrote: > > Ah..I should've noticed this earlier, but you are missing the > mandatory > first argument 'request' in your

Re: 'got multiple values for keyword argument' error

2006-06-22 Thread Corey Oordt
Nope, I get the same thing with: def select_date_for_pub(pub=None, template_name=None): But, interestingly, if I switch the arguments to: def select_date_for_pub(template_name=None, pub=None): I get the same error, but with template_name instead of pub! Any ideas? Thanks, Corey On Jun

Re: 'got multiple values for keyword argument' error

2006-06-22 Thread Corey Oordt
Here is the view: def select_date_for_pub(pub, template_name=None): """ Given a publication code, generate a view of a calendar with dates that can be selected """ date_list = Publication.objects.get

Re: 'got multiple values for keyword argument' error

2006-06-22 Thread Corey Oordt
It doesn't happen in the view. That's the strange thing. Here is the full error:Request Method:  GETRequest URL: http://localhost:8000/reservations/pubs/42/Exception Type: TypeErrorException Value: select_date_for_pub() got multiple values for keyword argument 'pub'Exception Location:

'got multiple values for keyword argument' error

2006-06-22 Thread Corey Oordt
Hey All! I'm trying to debug a view but I'm getting an error that I can't trace. The error is: TypeError at /reservations/pubs/42/ select_date_for_pub() got multiple values for keyword argument 'pub' but the local vars in the error screen shows: callback_kwargs {'template_name':

Re: A template tag contribution

2006-06-16 Thread Corey Oordt
Thanks Malcolm,It's done and there!http://code.djangoproject.com/wiki/ColumnizeTagCoreyOn Jun 16, 2006, at 9:42 AM, Malcolm Tredinnick wrote:Hi Corey,On Fri, 2006-06-16 at 09:07 -0400, Corey Oordt wrote: I have no idea if this is the right place to post such a thing, but  in an effort to give

A template tag contribution

2006-06-16 Thread Corey Oordt
I have no idea if this is the right place to post such a thing, but in an effort to give something back to the community, I would like to post a template tag I developed: Comments are appreciated, Thanks, Corey -- "Tags used by the

Re: Custom template tags not loading

2006-06-15 Thread Corey Oordt
I'm going to bow my head in shame I was SURE that I put it there! Thanks for making me look ivan! Corey On Jun 15, 2006, at 5:19 PM, [EMAIL PROTECTED] wrote: > > make sure your application exists in the project's settings file > INSTALLED_APPS > > > >

Re: Custom template tags not loading

2006-06-15 Thread Corey Oordt
Don,Thanks for the reply. When I put in {% load reservations.reservationtags %} I get:'reservations.reservationtags' is not a valid tag library: Could not load template library from django.templatetags.reservationtags, No module named reservationtagsAny other ideas?Thanks,CoreyOn Jun 15, 2006, at

Re: Django on Intel mac?

2006-06-07 Thread Corey Oordt
I have MacBook, and although it was a challenge to get everything up and running, I ended up using darwinports to install apache 2, mysql 5 and python 2.4. Everything is working really well now Corey Oordt On Jun 6, 2006, at 9:36 PM, Greg Harman wrote: > > > Oliver Kiess