Re: override __hash__ in django.db.base.Model
I was totally wrong to open this ticket, since http://docs.python.org/ref/customization.html: """ If a class defines mutable objects and implements a __cmp__() or __eq__() method, it should not implement __hash__() """ And django model is a mutable object. so we can't implement __hash__() --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
Re: Call for testing: New setup.py
Worked fine. WinXP SP2, 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
Re: MSSQL Support
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: > > > > > > 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 that I've found. I've been running a production > > > site using this patch for about a month now, and the MSSQL integration > > > seems to be stable. > > > > > > I'd appreciate it if other MSSQL users could give the patch a try. > > > The one item missing from the ticket is paging, but MSSQL doesn't > > > support that natively, so any input regarding that problem would also > > > be most appreciated. > > > > > > If the Django-users list is the more appropriate place for this > > > message, please let me know. > > > > > > Thanks, > > > > What version of SQL Server have you been testing with? I think in 2005 > > there is support for paging. This brings up the question of how to > > handle different versions of backends. > > > > > > > > > For 2005 you can use the new ROW_NUMBER() function to help with limit/offset: SELECT * FROM ( SELECT ROW_NUMBER() OVER (ORDER BY field DESC) AS Row, * FROM table) AS foo WHERE Row >= x AND Row <= y For 2000 I've seen people use this approach, which works if your sort field(s) are unique: SELECT * FROM ( SELECT TOP x * FROM ( SELECT TOP y fieldlist FROM table WHERE conditions ORDER BY field ASC) as foo ORDER by field DESC) as bar ORDER by field ASC So to get records 81-100, y is 100 and x is 20, and the inner-most select gets the top 100 rows. The middle select orders these in reverse order and gets the top 20. The outer select reverses these again to put them in the right order. I'm not sure where if the db backends separate responsibilities enough to allow you to wrap this up nicely in the SQL server backend. But it might work. --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
Re: MSSQL Support
I'll take a look around and see if there is a proper place for these statements. I had just come across the statement you posted for SQL Server 2000, so we're probably looking in the same places to solve the problem. On 10/22/06, DavidA <[EMAIL PROTECTED]> wrote: > > > 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: > > > > > > > > > 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 that I've found. I've been running a production > > > > site using this patch for about a month now, and the MSSQL integration > > > > seems to be stable. > > > > > > > > I'd appreciate it if other MSSQL users could give the patch a try. > > > > The one item missing from the ticket is paging, but MSSQL doesn't > > > > support that natively, so any input regarding that problem would also > > > > be most appreciated. > > > > > > > > If the Django-users list is the more appropriate place for this > > > > message, please let me know. > > > > > > > > Thanks, > > > > > > What version of SQL Server have you been testing with? I think in 2005 > > > there is support for paging. This brings up the question of how to > > > handle different versions of backends. > > > > > > > > > > > > > > > For 2005 you can use the new ROW_NUMBER() function to help with > limit/offset: > > SELECT * FROM ( > SELECT ROW_NUMBER() OVER (ORDER BY field DESC) > AS Row, * FROM table) > AS foo > WHERE Row >= x AND Row <= y > > For 2000 I've seen people use this approach, which works if your sort > field(s) are unique: > > SELECT * FROM ( > SELECT TOP x * FROM ( > SELECT TOP y fieldlist > FROM table > WHERE conditions > ORDER BY field ASC) as foo > ORDER by field DESC) as bar > ORDER by field ASC > > So to get records 81-100, y is 100 and x is 20, and the inner-most > select gets the top 100 rows. The middle select orders these in reverse > order and gets the top 20. The outer select reverses these again to put > them in the right order. > > I'm not sure where if the db backends separate responsibilities enough > to allow you to wrap this up nicely in the SQL server backend. But it > might work. > > > > > --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
FormField.html2python is a static method. Why?
FormField and its subclasses should define html2python as a static method, and FormField.convert_post_data calls the method so that it must be static: self.__class__.html2python(data) So, it is impossible to access the field's instance attributes while converting data. I've just faced a need of field object's state inside html2python (I use custom FormField subclasses in my custom manipulators that make use of some state). Can anybody explain why html2python is treated this way (I suppose it was done intentionally)? I don't see any security or performance reasons for that ... --- regards, Max --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
Data for globalization
I have been working in creating tables in format CSV for the globalization (G11n), so that they can be used in any project where it could be necessary or useful. You can see the tables on: http://satchmo.python-hosting.com/browser/trunk/satchmo/G11n/data/ And here you have the files for add/integrate them to any Django project: http://satchmo.python-hosting.com/file/trunk/satchmo/G11n/ http://satchmo.python-hosting.com/file/trunk/satchmo/load_G11n.py Some cool things that can be done with all those data: * area.csv, phone.csv Now, Django has two field types for USA, USStateField and PhoneNumberField. But we could have validators for phones of each country. And a drop list as USStateField for another countries where it is necessary for the potstal address as Canada, Mexico, Italy, etc. * country-language.csv, timezone.csv Now, there is to edit the 'settings.py' file to choosing both the language code and local time zone for the installation. But the administrator has to go to a web for lookiing those data, and then edit that file. It's clear that it would be more easy and cool if the administrator could to choosing both data from Django admin, with the help of those tables. In addition, we could use timezone.csv to show to the users its local time according to its configuration. In the users registry it must have an option so that the user could choose his/her time zone. With country-language.csv, we also could to know directly the language and country of the user (using the HTTP header). * country.csv, language.csv With those tables we could show to the user a drop list fot that could choosing those data. In addition with country.csv we can show the correct name for each country about the area. The area is the primary subdivision of a country called state in USA, or province in Canada. But the best interesting is that instead of have a drop list with all countries _it's very heavy that a user is looking for a country into a list of 230+ countries_, we could to have a drop list with the geographical region. In the first a drop list with continents (America), then with its subdivisions (Caribbean, Central America, South America, Northern America), and finally the countries of that subdivision. There will be another table about postal codes. And I have compiled all flags images (SVG format) of all countries that are in globalization files. Now I would that Django developers could to integrate these tables with django, because without a doubt it has many advantages to both the administrators and the users. --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
Functional benchmark Rails - Django - CakePHP
Hello, I'm currently writing a functional benchmark for french press (IT news, programming magazine) about Django, Ruby on Rails and CakePHP. I started to fill one Excel sheet with Django's assets but then I thought that Django's community would be interested and much more skilled than me to do that intself. So I'm asking you if you could add some more stuff to this spreadsheet. Feel free to send it to other Django users, so that I could have more information. The only problem, is that I'm kinda in a rush right now since I have to finish this benchmark next week so it would be perfect if you can send me this back on ASAP to [EMAIL PROTECTED] Youc can find the sheet at http://www.jchatard.info/django.xls Best regards, Jérémy --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
a utility function to return html for given url?
Is there a function which takes a string representaiton of a url and returns the html for that url? (in other words, this function takes a url, calls up its corresponding function in views.py, and returns its output?) I am doing an experiment by writing a sort of "import" tag which will take a url as an argument and return the rendered page which can be included into a 'master' page. Similar to the include tag, but it doesn't just import the template, it imports and actual html rendered by the given url. As far as I can tell, neither the import tag, nor the template heirarchy do exactly what I am trying to accomplish for my app. Thanks. --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
Another DB Issue
http://pastebin.ca/214049 Seems to randomly pop up like my other one --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
Re: Data for globalization
On 10/14/06, GinTon <[EMAIL PROTECTED]> wrote: > Now I would that Django developers could to integrate these tables with > django, because without a doubt it has many advantages to both the > administrators and the users. I've tinkered once or twice with the idea of doing a 'django.contrib.locale' kind of app, which would supply models for things like time zones, postal codes, etc., and include data to populate instances of them automatically -- so that you'd be able to do things like, say, a foreign key to TimeZone in a user profile model, it's just always been a back-burner kind of project because I always had more pressing things to do. If you'd be interested in helping to develop useful models for that using this data, that'd be great :) -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
Re: a utility function to return html for given url?
On Sun, 2006-10-22 at 05:59 +, falcon wrote: > Is there a function which takes a string representaiton of a url and > returns the html for that url? (in other words, this function takes a > url, calls up its corresponding function in views.py, and returns its > output?) No. > > I am doing an experiment by writing a sort of "import" tag which will > take a url as an argument and return the rendered page which can be > included into a 'master' page. Similar to the include tag, but it > doesn't just import the template, it imports and actual html rendered > by the given url. As far as I can tell, neither the import tag, nor > the template heirarchy do exactly what I am trying to accomplish for my > app. You will have to implement the logic in django.handlers.base.BaseHandler.get_response(). The tricky thing will be that many views rely upon a request object existing and/or middleware having been run, so setting up the pre-requisites correctly without ruining your existing environment (session, etc) will require some awareness of your views' requirements. (This is probably better suited to django-users, by the way.) Regards, Malcolm --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
Re: Data for globalization
I also developed the Django models for those data: http://webda.python-hosting.com/browser/trunk/Django/I18n Please, post your message in this group http://groups.google.com/group/webda I would to have all discussion related to globalization data in the same group. So it could be usefull for that anothers frameworks could implementing those data too. Thanks! --~--~-~--~~~---~--~~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---