Serialization issue: order matters

2007-07-02 Thread jj
I recently switched my backend from sqlite3 to mysql. The interim export format was XML. I had already repopulated my sqlite3 database several times from the XML dump, without any problem, but this time came across the following issue: mysql does not like forward references. I.e. the XML dump has

Re: Serialization issue: order matters

2007-07-02 Thread Malcolm Tredinnick
On Mon, 2007-07-02 at 00:31 -0700, jj wrote: > I recently switched my backend from sqlite3 to mysql. The interim > export format was XML. I had already repopulated my sqlite3 database > several times from the XML dump, without any problem, but this time > came across the following issue: mysql doe

Re: Could you please share your django-based website source code with me?

2007-07-02 Thread Kenneth Gonsalves
On 02-Jul-07, at 11:15 AM, nick feng wrote: > Will anybody share your django-based website source code with me ? > Thank you very much! > I promise that your codes is only used for my studying django. http://nrcfosshelpline.in/code/ <-- use it as you like. It is not state

Ideas for performance improvement?

2007-07-02 Thread jj
I have an app which handles, lets say, Books. I'd like to display up to 1,000 of them on a single page. I don't really want to use pagination. However, this creates a little bit of a performance problem. Has anyone experienced such a situation and come up with a good setup? A little more about my

Re: Serialization issue: order matters

2007-07-02 Thread jj
The latter. Thanks Malcolm. The patch is a little ugly indeed, but easier than rearranging the XML by hand. JJ. On Jul 2, 9:40 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2007-07-02 at 00:31 -0700, jj wrote: > > I recently switched my backend from sqlite3 to mysql. The interim >

Re: Ideas for performance improvement?

2007-07-02 Thread Jeremy Dunck
On 7/2/07, jj <[EMAIL PROTECTED]> wrote: > > I have an app which handles, lets say, Books. I'd like to display up > to 1,000 of them on a single page. How many HTTP requests? How many queries? How many bytes in response? What web server? ... > - Books have Authors, Publishers, etc. I use select_

Sybase support for Django

2007-07-02 Thread adm
Has anybody used sybase with Django? I couldn't find any references. adm --~--~-~--~~~---~--~~ 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 u

Re: Developing in windows

2007-07-02 Thread Alexander Pugachev
You must have "django" directory in site-packages, not "django-0.96". You better make symlink "django" to corresponding directory under "django-0.96". To create symlink in Windows, use "junction" utility. It can be easily found with Google. 2007/6/30, Vladimir Pouzanov <[EMAIL PROTECTED]>: > > > O

Re: Ideas for performance improvement?

2007-07-02 Thread jj
On Jul 2, 10:00 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > How many HTTP requests? It's only me testing at the moment, and it's already slow enough. > How many queries? 1, essentially: Book.objects.select_related(). Plus access to 5 foreign objects per book. > How many bytes in response?

Re: Ideas for performance improvement?

2007-07-02 Thread Tim Chase
> if not book_list: > book_list = Book.objects.select_related() > cache.set('all_books', book_list) > book_list = [b for b in book_list if b.is_visible_by(user)] Unless "is_visible_by" is a python-side piece of code, you'd likely get much better results not having your ent

manage.py validate error

2007-07-02 Thread [EMAIL PROTECTED]
I'm currently creating models (quite a bit of them) using Django and I find it hard to "debug" them. "./manage.py validate" usually returns errors with no context nor line numbers, and sometimes the error comes from an import and is wrongly attributed to the including file rather that the include

Re: Could you please share your django-based website source code with me?

2007-07-02 Thread Tyson Tate
:) -Tyson > On 7/2/07, nick feng <[EMAIL PROTECTED]> wrote: Hi All, > > I plan to build a django-based website for open-sourcing these > days, I have read the django-book. > Since my limited knowledge of

Re: Could you please share your django-based website source code with me?

2007-07-02 Thread Adam Fast
Jeff Croft's lost-theories.com site is also a good learning tool. http://www2.jeffcroft.com/blog/2007/may/28/lost-theoriescom-source-code-update/ On 7/2/07, nick feng <[EMAIL PROTECTED]> wrote: > > Hi All, > > I plan to build a django-based website for open-sourcing these days, I > have read th

Re: Could you please share your django-based website source code with me?

2007-07-02 Thread Bryan L. Fordham
I don't know that I ever listened to his message at the mormon tabernacle. http://www.rzim.org/radio/archives.php?p=JT&v=detail&id=784 is the first part --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users

Re: Could you please share your django-based website source code with me?

2007-07-02 Thread Bryan L. Fordham
oh wow, I don't know how I managed to send that to this list. That was a reply to a private email, having nothing to do with Django. Obviously. Sincere apologies --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

BBC NEWS http://bbcworldnews.blogcu.com

2007-07-02 Thread ALİ ÖZTÜRK Economist
BBC NEWS http://bbcworldnews.blogcu.com Bush and Putin in informal talks http://bbcworldnews.blogcu.com/3471077 Turning 'Ayasofya' into a cathedral http://bbcworldnews.blogcu.com/3471276 Chavez in Iran on anti-US tour http://bbcworldnews.blogcu.com/3471639 --~--~-~--~~---

Re: Could you please share your django-based website source code with me?

2007-07-02 Thread KpoH
http://code.djangoproject.com/svn/djangoproject.com/django_website/ :) On Monday 02 July 2007 06:45:38 nick feng wrote: >> Hi All, >> >> I plan to build a django-based website for open-sourcing these days, I have >> read the django-book. Since my limited knowledge of web developing(this is >> my

contenttypes

2007-07-02 Thread Lic. José M. Rodriguez Bacallao
Hi everyone, I really need some help on the contentypes app, could someone explain me how it work with an example, I have read a little explanation on: http://feh.holsman.net/articles/2006/06/03/django-contenttype but its very vague. Could someone help me please? -- Lic. José M. Rodriguez Bacalla

Newbie Question: site working in dev, not in production...probable issue with httpd.conf

2007-07-02 Thread Wiley
Here's the ultra-newbie question of the day. I have a lil' site running well under runserver, when I hook it up to apache2 and mod_python, something goes wrong. For the EXACT same python/django code, the admin site and all URLS come up fine in the built-in server. When I switch to the apache se

Re: Newbie Question: site working in dev, not in production...probable issue with httpd.conf

2007-07-02 Thread Vincent Nijs
If you change your conf settings to the following do you still have the same problem? SetHandler python-program PythonPath "[ '/usr/local/django_projects/' ] + sys.path" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE beijing_eats.settings Py

Re: caching between successive calls to model.objects.all()?

2007-07-02 Thread [EMAIL PROTECTED]
In case my original post was too unfriendly, here's my issue in plain terms: 1. I call model.objects.all() in an interactive shell 2. I modify the db directly in a different shell 3. I call model.objects.all() in the first shell again, and it doesn't pick up my changes. what's going on? i'm sure

Re: Newbie Question: site working in dev, not in production...probable issue with httpd.conf

2007-07-02 Thread Nicolas Steinmetz
Wiley a écrit : > Here's the ultra-newbie question of the day. > > I have a lil' site running well under runserver, when I hook it up to > apache2 and mod_python, something goes wrong. For the EXACT same > python/django code, the admin site and all URLS come up fine in the > built-in server. Wh

Re: Newbie Question: site working in dev, not in production...probable issue with httpd.conf

2007-07-02 Thread Wiley
That did the trick, thanks guys! Now I'm trying to figure out how to serve my static content (I think Vincent anticipated that this would be my next problem :) ) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja

index.html

2007-07-02 Thread Carl Karsten
how do I set a default anything for when a user hits http://foo.com they get index.html or any other file? I can see having a static file that does a redirect - wondering if there isn't a better way. Carl K --~--~-~--~~~---~--~~ You received this message becaus

Re: Ideas for performance improvement?

2007-07-02 Thread Jeremy Dunck
On 7/2/07, jj <[EMAIL PROTECTED]> wrote: > > How many HTTP requests? > > It's only me testing at the moment, and it's already slow enough. Sorry, I meant how many HTTP requests *per page*, as in, how many external resource references? Are you serving media off a separate server, or though apach

Re: index.html

2007-07-02 Thread Dennis Kaarsemaker
On ma, 2007-07-02 at 12:49 -0500, Carl Karsten wrote: > how do I set a default anything for when a user hits http://foo.com they get > index.html or any other file? I can see having a static file that does a > redirect - wondering if there isn't a better way. If your root is served by django,

Re: Questions about Django Templating

2007-07-02 Thread rtconner
Well I want my subject back, and I'll fight for it if I have to. On Jul 2, 9:21 am, "Bryan L. Fordham" <[EMAIL PROTECTED]> wrote: > oh wow, I don't know how I managed to send that to this list. That was a > reply to a private email, having nothing to do with Django. Obviously. > > Sincere apologi

Re: index.html

2007-07-02 Thread Carl Karsten
Dennis Kaarsemaker wrote: > On ma, 2007-07-02 at 12:49 -0500, Carl Karsten wrote: >> how do I set a default anything for when a user hits http://foo.com they get >> index.html or any other file? I can see having a static file that does a >> redirect - wondering if there isn't a better way. > >

Re: newbie: trying to understand django templates

2007-07-02 Thread Vincent Nijs
By using: python manage.py shell all the 'settings' are taken care of for you so you don't have to do any exports or anything like that. The import statement for Context and Template should work fine when you use the above command. Vincent On 7/2/07 2:14 PM, "walterbyrd" <[EMAIL PROTECTED]> w

Re: index.html

2007-07-02 Thread Vincent Nijs
Why not just put (r'^$', home) in your urls.py, pointing to home in views.py which renders an html page as you would with your other pages? Vincent On 7/2/07 2:16 PM, "Carl Karsten" <[EMAIL PROTECTED]> wrote: > > Dennis Kaarsemaker wrote: >> On ma, 2007-07-02 at 12:49 -0500, Carl Karsten

Re: newbie: trying to understand django templates

2007-07-02 Thread walterbyrd
On Jul 2, 1:24 pm, Vincent Nijs <[EMAIL PROTECTED]> wrote: > all the 'settings' are taken care of for you so you don't have to do any > exports or anything like that. The import statement for Context and Template > should work fine when you use the above command. > Okay, but what happens if I'm

Re: newbie: trying to understand django templates

2007-07-02 Thread Carl Karsten
walterbyrd wrote: > On Jul 2, 1:24 pm, Vincent Nijs <[EMAIL PROTECTED]> > wrote: > >> all the 'settings' are taken care of for you so you don't have to do any >> exports or anything like that. The import statement for Context and Template >> should work fine when you use the above command. >> >

Re: caching between successive calls to model.objects.all()?

2007-07-02 Thread Benjamin Slavin
Hello. You mention you are using the multi-db branch. Do you get this behavior in trunk? What happens if you update a user from within the Django management shell? Does this result in a correct QuerySet from all()? Are you under transaction management in the management shell? If so, depending

Re: caching between successive calls to model.objects.all()?

2007-07-02 Thread Lawrence Wang
On 7/2/07, Benjamin Slavin <[EMAIL PROTECTED]> wrote: > > > Hello. > > You mention you are using the multi-db branch. Do you get this > behavior in trunk? i haven't tried this yet because i require multi-db functionality, so it does me no good if it works in trunk :) but i understand the value o

Dynamic Language Ninja (or Pirate) - Telecommuting Allowed

2007-07-02 Thread [EMAIL PROTECTED]
Greetings. Etsy is an online marketplace for buying and selling all things handmade: clothing, music, furniture, software, jewelry, robots. We launched on June 18, 2005, and ever since then have been empowering our users to make a living doing what they love most. We are seeking an experienced d

Re: crosstabs

2007-07-02 Thread Tim Chase
> here it is: http://webapps.ubuntu.com/course_locator/ > > Click on Canada, and see what would ideally be a cross tab. > > The problem is, I'd like to have the event dates for training > events for the same course in the same town on the same row > (notice that several rows there differ only in

newbie: trying to understand django templates

2007-07-02 Thread walterbyrd
I am going through the django book. I am on Chapter 4: The Django template system. In the example given, the first line reads: >>> from django.template import Template, Context But, that will produce a screen full of errors. In the comments, it is suggested to change to the directory in which

Re: newbie: trying to understand django templates

2007-07-02 Thread walterbyrd
On Jul 2, 2:30 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: > walterbyrdwrote: > > On Jul 2, 1:24 pm, Vincent Nijs <[EMAIL PROTECTED]> > > wrote: > > >> all the 'settings' are taken care of for you so you don't have to do any > >> exports or anything like that. The import statement for Context an

Re: newbie: trying to understand django templates

2007-07-02 Thread Carl Karsten
walterbyrd wrote: > > > On Jul 2, 2:30 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: >> walterbyrdwrote: >>> On Jul 2, 1:24 pm, Vincent Nijs <[EMAIL PROTECTED]> >>> wrote: all the 'settings' are taken care of for you so you don't have to do any exports or anything like that. The import s

Re: newbie: trying to understand django templates

2007-07-02 Thread walterbyrd
I continue to be frustrated with examples given in this book, which simply do not work. I am trying to follow the code examples in the book. In chapter 4, the book gives this code example: from django.shortcuts import render_to_response import datetime def current_datetime(request): now = d

Re: newbie: trying to understand django templates

2007-07-02 Thread Vincent Nijs
They worked for me. So you maybe missing something :) Is urls.py still trying to import the hours_ahead function? If that doesn't help try posting your code. Vincent On 7/2/07 6:36 PM, "walterbyrd" <[EMAIL PROTECTED]> wrote: > > I continue to be frustrated with examples given in this book, w

Re: Working '/comments/flag/[comment.id here]/' examples?

2007-07-02 Thread JHeasly
On Jun 29, 6:05 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > Very odd. UserFlag has an objects attribute which is an of > UserFlagManager. Looking at the svn source, I don't see how UserFlag > in views.userflags.flag() could refer to a UseFlagManager object > rather than the UserFlag model.

Re: newbie: trying to understand django templates

2007-07-02 Thread walterbyrd
On Jul 2, 5:13 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: > "not using X" does not say what you are doing - my best guess is "what will be > available if I just run python?" if so, the answer is "nothing other than you > can import django." As I mentioned, this is what I was trying to do: >>>

Re: Working '/comments/flag/[comment.id here]/' examples?

2007-07-02 Thread Jeremy Dunck
On 7/2/07, JHeasly <[EMAIL PROTECTED]> wrote: > Sorry, I didn't mean to convey that ... userflags.flag() refers to > UserFlagManager directly. Ah, ok. Yeah, this has been broken a long while. The comments contrib needs some love, but I understand Jacob's working on a rewrite, hence the lack of b

How do I override a model method?

2007-07-02 Thread Michael Lake
Hi all I'm having problems overriding a method in a model. I have seen how to override the save and delete methods and overriding a save works fine http://www.djangoproject.com/documentation/model-api/ But I'm trying to override other automatically generated methods. Currently if I create a pr

Re: newbie: trying to understand django templates

2007-07-02 Thread walterbyrd
On Jul 2, 5:43 pm, Vincent Nijs <[EMAIL PROTECTED]> wrote: > They worked for me. So you maybe missing something :) > > Is urls.py still trying to import the hours_ahead function? If that doesn't > help try posting your code. That was exactly it. I removed the hours_ahead parameter from the patt

Re: newbie: trying to understand django templates

2007-07-02 Thread Carl Karsten
walterbyrd wrote: > On Jul 2, 5:13 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: > >> "not using X" does not say what you are doing - my best guess is "what will >> be >> available if I just run python?" if so, the answer is "nothing other than >> you >> can import django." > > As I mentioned,

Re: newbie: trying to understand django templates

2007-07-02 Thread Malcolm Tredinnick
On Mon, 2007-07-02 at 18:15 -0700, walterbyrd wrote: > On Jul 2, 5:13 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: > > > "not using X" does not say what you are doing - my best guess is "what will > > be > > available if I just run python?" if so, the answer is "nothing other than > > you > > c

Re: How do I override a model method?

2007-07-02 Thread Malcolm Tredinnick
On Tue, 2007-07-03 at 11:35 +1000, Michael Lake wrote: > Hi all > > I'm having problems overriding a method in a model. > I have seen how to override the save and delete methods and overriding a save > works > fine http://www.djangoproject.com/documentation/model-api/ > But I'm trying to overri

Re: Dynamic Language Ninja (or Pirate) - Telecommuting Allowed

2007-07-02 Thread Kenneth Gonsalves
On 03-Jul-07, at 2:58 AM, [EMAIL PROTECTED] wrote: > Problem: In the dynamic language of your choice, write a short program > that will: > > 1. define a list of the following user ids 42346, 77290, 729 (you can > hardcode these, but it should still work with more or less ids) > 2. retrieve an

Re: contenttypes

2007-07-02 Thread Russell Keith-Magee
On 7/2/07, Lic. José M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote: > Hi everyone, I really need some help on the contentypes app, could someone > explain me how it work with an example, I have read a little explanation on: > http://feh.holsman.net/articles/2006/06/03/django-contenttype > but it

Re: How do I override a model method?

2007-07-02 Thread Michael Lake
Hi > On Tue, 2007-07-03 at 11:35 +1000, Michael Lake wrote: >>I'm having problems overriding a method in a model. >>I have seen how to override the save and delete methods and overriding a save >>works >>fine http://www.djangoproject.com/documentation/model-api/ >>But I'm trying to override oth

Re: How do I override a model method?

2007-07-02 Thread Malcolm Tredinnick
On Tue, 2007-07-03 at 13:02 +1000, Michael Lake wrote: [...] > > I didn't realise I was dealing with both attributes and methods and they were > different. I see the Django docs say "Each field is specified as a class > attribute, > and each attribute maps to a database column." I'll have to d

Re: Sybase support for Django

2007-07-02 Thread Russell Keith-Magee
On 7/2/07, adm <[EMAIL PROTECTED]> wrote: > > Has anybody used sybase with Django? > I couldn't find any references. Sybase isn't on the currently supported database list, and I'm not aware of any plans to add support for Sybase. If you want to try your hand at adding support for Sybase, feel fr

Re: How do I override a model method?

2007-07-02 Thread Michael Lake
Hi Thanks, I'll try and follow it better by re-reading it in conjuction with my Python books. But aleady it's changed my view of Python. Instead of visualising a large thick Python snake I now see a writing mass of pythons, Medusa like, as I concentrate on my Django project :-) "Nea

As if multiple-db wasn't hard enough :(...

2007-07-02 Thread Ben Ford
Hi All, I have a bit of an issue that I'd like to kick around here before I start diving into it... I'm using the multi-db branch, which I've recently merged all of the latest stuff in trunk into. It's all working quite nicely, my app runs on PostgreSQL and I have to talk to an Oracle database as

Re: manage.py validate error

2007-07-02 Thread Russell Keith-Magee
On 7/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I'm currently creating models (quite a bit of them) using Django and I > find it hard to "debug" them. "./manage.py validate" usually returns > errors with no context nor line numbers, and sometimes the error comes > from an import and is

Re: Sybase support for Django

2007-07-02 Thread adm
Russ, I sure can try that. The problem is I haven't gone through the Django framework in details as such, which make me quite helpless while adding the support. And that is becuase I am not proficient in Python. All I expect is there will be some wrapper classes for databsae interface, under

Re: As if multiple-db wasn't hard enough :(...

2007-07-02 Thread Malcolm Tredinnick
On Tue, 2007-07-03 at 11:51 +0700, Ben Ford wrote: > Hi All, > > I have a bit of an issue that I'd like to kick around here before I > start diving into it... > > I'm using the multi-db branch, which I've recently merged all of the > latest stuff in trunk into. It's all working quite nicely, my

Re: Sybase support for Django

2007-07-02 Thread Russell Keith-Magee
On 7/3/07, adm <[EMAIL PROTECTED]> wrote: > > Russ, > I sure can try that. The problem is I haven't gone through the > Django framework in details as such, which make me quite helpless > while adding the support. Thats fine. However, as fair warning - this is the first time that Sybase supp

Re: Sybase support for Django

2007-07-02 Thread Kenneth Gonsalves
On 03-Jul-07, at 11:33 AM, Russell Keith-Magee wrote: >> It may seem incorrect for you to talk on this without looking into >> code. > > Well, I'm one of the Django core developers, and I've made plenty of > changes to the database backends over the years - so I'm fairly well > qualified to spea

Re: Sybase support for Django

2007-07-02 Thread adm
Thank you KG for correction. Russ thanks to you also for information. On Jul 3, 11:10 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 03-Jul-07, at 11:33 AM, Russell Keith-Magee wrote: > > >> It may seem incorrect for you to talk on this without looking into > >> code. > > > Well, I'm one o

Re: As if multiple-db wasn't hard enough :(...

2007-07-02 Thread Ben Ford
Hi Malcolm, Thanks for the well thought out response... I've had a bit more of a think about it over lunch and the metaclass bit is a non starter: it's instantiation I need to worry about not class creation. In theory I will always know which database to find RANObjects and their related models in.