Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-12-05 Thread DavidA
John Lenton wrote: > > I hadn't even considered having a multi-parameter tuple-returning > "sum"; I was ok with either calling groupby thrice, or saving the > groupby and calling the different ops in sequence. In either case, a > database roundtrip per call. I'm often grouping thousands of rows

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-12-05 Thread DavidA
Russell Keith-Magee wrote: > annotate() returns a query set, so it can be used multiple times, be > combined with filters, etc. The argument handling strategy employed in > filter() is reused here; kwargs to annotate() can be decomposed on a > __ boundary to describe table joins, with the last pa

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-12-04 Thread DavidA
Jacob Kaplan-Moss wrote: > No, I think not -- I think that syntax (``queryset.groupby(field).max()``) > actually looks like the best proposal for aggregates I've seen thus far... > > Thoughts, anyone? > > Jacob I think it quickly gets more complicated than that syntax would support. For example,

Re: MSSQL Support

2006-10-22 Thread DavidA
Sean De La Torre wrote: > I've been testing with SQL Server 2000 and MSDE. When I have more > time I intend to install SQL Server 2005 Express to see if there are > any issues with the newer versions. > > On 10/21/06, DavidA <[EMAIL PROTECTED]> wrote: > >

Re: MSSQL Support

2006-10-21 Thread DavidA
Sean De La Torre wrote: > I've been maintaining/enhancing a ticket > (http://code.djangoproject.com/ticket/2358) contributed by another > django user that adds MSSQL support to django. In addition to what > that user started, I've added full introspection capabilities and > patched a few bugs th

Re: Call for testing: New setup.py

2006-10-17 Thread DavidA
DavidA wrote: > I spoke too soon. I _really_ spoke too soon. I tried again as 'python setup.py install' rather than 'setup.py install' and it worked. For some reason my file type mapping on this particular Win box was mucked up. --~--~-~--~~--

Re: Call for testing: New setup.py

2006-10-17 Thread DavidA
DavidA wrote: > Works on Windows 2003 Server SP1 + Python 2.4.2 I spoke too soon. I tried to run 'manage.py test' and it complained about an invalid action so I poked around and the management.py in C:\Python24\lib\site-packages\django\core was different than the one in the

Re: Call for testing: New setup.py

2006-10-17 Thread DavidA
Works on Windows 2003 Server SP1 + Python 2.4.2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from

Re: Potential bug in django.core.handlers.modpython ?

2006-10-16 Thread DavidA
Waylan Limberg wrote: > My guess is the problem lies in your Apache settings. Post a copy of > your mod-python settings and we'll see what we come up with. Here you go (C:/pf/src/pfweb is the Django project directory): NameVirtualHost * ServerName web DocumentRoot "C:/pf/src/pfweb"

Re: Potential bug in django.core.handlers.modpython ?

2006-10-16 Thread DavidA
Steven Armstrong wrote: > Have you got a folder/file named 'data' in your apaches document root? > If so, try nuking or renaming it. No. And no virtual directories or aliases named 'data' either, nor a file or folder named 'data' in my django project directory. Note that the page URL is working

Potential bug in django.core.handlers.modpython ?

2006-10-16 Thread DavidA
Hi, I noticed an inconsistency between the request META information in the modpython handler versus the base handler. I'm opening the URL http://web/data/pos/ which goes through two URL conf's: The default urls.py for the application: (r'^data/', include('pfweb.core.urls')), And the urls.p

Re: CharFields and children defaulting to emtpy string

2006-09-17 Thread DavidA
gabor wrote: > > assuming that you want to differentiate between: > > - the user did not fill in the data > - the user's input was "" > > wouldn't it be better to represent this in html as a checkbox+an input > field? > > and by default have the checkbox unselected, and the input-field disabled.

Re: CharFields and children defaulting to emtpy string

2006-09-16 Thread DavidA
Malcolm Tredinnick wrote: > When I first started using Django, this drove me nuts. I had the same reaction, but also understand there isn't a great way to handle it. In Microsoft's SQL Enterprise Manager, you can enter Ctrl-0 in a field and it will set that field to NULL. I'm thinking about doi

Re: Validation Aware Models and django.forms on steroids

2006-08-25 Thread DavidA
One comment on ValidationErrors: When I've done these types of things in the past, I've typically returned two levels of validations messages: warnings and errors. An error indicates that the attempted save will fail (i.e. it would either cause a an object to be saved in an invalid state or it wou

Re: Model inheritance API

2006-07-24 Thread DavidA
Malcolm Tredinnick wrote: > On Sun, 2006-07-23 at 17:12 +0100, Bill de hÓra wrote: > > Malcolm Tredinnick wrote: > > > --- > > > 3. What you don't get > > > --- > > > [...] > > > I am not implementing the "everything in one table" storage model. It is > >

Re: MS-SQL server LIMIT/OFFSET implementation

2006-07-21 Thread DavidA
> > On Thu, 2006-07-20 at 17:34 -0400, Dan Hristodorescu wrote: > > > > > > and for SQL 2000 should look like this: > > > > > > SELECT fields FROM table > > > WHERE primary key IN > > > (SELECT TOP limit primary_key FROM table > > > WHERE primary_key NOT IN > >

Re: avoiding ADD CONSTRAINT in management.syncdb()

2006-07-19 Thread DavidA
Malcolm Tredinnick wrote: > > That is also possible, but I was trying to avoid another reliance on the > backend (things like "sqlall" start to get complex). Still, it's > probably only a single proxy function call, so not too hard to maintain. > > I'm sure if I keep coming up with bad implementa

Re: avoiding ADD CONSTRAINT in management.syncdb()

2006-07-19 Thread DavidA
Malcolm Tredinnick wrote: > I was trying to avoid a hash-based solution because it leads to > unreadable names (and I don't think every database supports unnamed > constraints, so that isn't a universal solution, either). I need to do a > bit of research and them come up with a legal hash constru

Re: avoiding ADD CONSTRAINT in management.syncdb()

2006-07-19 Thread DavidA
Malcolm Tredinnick wrote: > On Wed, 2006-07-19 at 11:24 +0000, DavidA wrote: > > MySQL requires each constraint to have the same name. > > I'm pretty sure you meant to say "different name" there. :-) Oops. I guess that's what the "preview" button is

Re: avoiding ADD CONSTRAINT in management.syncdb()

2006-07-19 Thread DavidA
Alexis Smirnov wrote: > ALTER TABLE `console_restoreevent` ADD CONSTRAINT > `identity_id_referencing_console_identity_id` FOREIGN KEY (`identity_i > d`) REFERENCES `console_identity` (`id`); > ALTER TABLE `console_backupevent` ADD CONSTRAINT > `identity_id_referencing_console_identity_id` FOREIGN

Re: Table options in CREATE TABLE..

2006-07-18 Thread DavidA
Geert, Just for the record, I use the "SQL initial data file" feature that Adrian mentioned to enable full-text indexing on a couple of my tables. The relevant part of my script is: ALTER TABLE data_rawtrade ENGINE=MyISAM; CREATE FULLTEXT INDEX ix_ft_data_rawtrade_all ON data_ra

Re: Syncdb generates non-unique foreign key constraints

2006-07-14 Thread DavidA
Michael Radziej wrote: > DavidA wrote: > > I've been having a problem rebuilding my database from scratch via > > syncdb. I've tracked it down to duplicate constraint name. Here is the > > output from manage.py sql for my app: > > ... > > This used to w

Syncdb generates non-unique foreign key constraints

2006-07-14 Thread DavidA
I mistakenly posted this in django-users so reposting here... -- I've been having a problem rebuilding my database from scratch via syncdb. I've tracked it down to duplicate constraint name. Here is the output from manage.py sql for my app: ALTER TABLE `data_rawinst` ADD CONSTRAINT `inst_id_refe

Re: RFC: Django history tracking

2006-06-20 Thread DavidA
Uros Trebec wrote: > > > To summarize, in the past I've used a time_from/time_thru pair of > > date/time columns to make it more efficient to retrieve the version of > > a row as it looked at a particular point in time. Your design of just > > using change_date makes this more difficult. > > I do

Re: RFC: Django history tracking

2006-06-15 Thread DavidA
There was a similar thread on this earlier where I commented about a slightly different way to store the changes: http://groups.google.com/group/django-users/browse_thread/thread/f36f4e48f9579fff/0d3d64b25f3fd506?q=time_from&rnum=1 To summarize, in the past I've used a time_from/time_thru pair of

Re: EVOLUTION - Add Field Schema Evolution Support

2006-05-29 Thread DavidA
> I am wondering how to retrieve a collection of columns within a table, > whilst using the standard python dbapi2 functionality. Do you mean cursor.description? cursor = connection.cursor() cursor.execute('select * from blog_post where 1 = 0') for col in cursor.description: print col Each

Re: +1 on part of #1810 (put parse_dsn() in django.conf)

2006-05-12 Thread DavidA
My issue with adding DSN support to Django isn't that its not useful to some people, but that it feels like we are adding functionality that belongs in the DB-API layer, not Django. In an ideal world, the database settings would just be passed verbatim to the connect() function of the appropriate

Re: ticket #347 mysql engine used for tables

2006-04-21 Thread DavidA
Maybe I don't understand the implications but I have been using ENGINE=MyISAM on my tables so I can use MySQLs full-text indexing (not supported by InnoDB). Does this thread imply that I can no longer use MyISAM tables with MySQL? Or just that if I do, I must tweak the output of manage.py (which

Bug in django/contrib/admin/templatetags/admin_list.py

2006-04-21 Thread DavidA
I posted this to django-users a few days ago but no one commented and I didn't see any mention of it here so I thought I'd repost to the dev group. I'm using M-R and just updated to 2721 and still didn't see a fix. If you use a FloatField in the admin list_display, you get an error rendering the