On 3/26/07, Honza Král <[EMAIL PROTECTED]> wrote: > On 3/26/07, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > > > > I would like to change the table of a model on the fly. > > I was looking into the Manager code, but since the get_query_set() > > method in there uses the model as is, changing the > > model._meta.db_table would most probably change the db_table for all > > users/threads, not only for the current one, right? > > > > Any ideas on how this could be achieved? > > just a quick thought: did you consider supplying db_table as a lazy > object that would evaluate to string based on current locale (which it > would obtain from thread locals)? I didn't check the code if this is > even possible, but it's just python, so it should....
that sounds pretty interesting, i will try that, since it sounds most promising. thank you! Wolfram > > > > The main reason I need this is that I want to have a transparent model > > that switches the underlying language (the according DB table it > > should work on) on the fly, so i can keep hacking away without > > language switching before every access via my model. > > > > -- > > cu > > > > Wolfram > > > > > > > > > > -- > Honza Kr�l > E-Mail: [EMAIL PROTECTED] > ICQ#: 107471613 > Phone: +420 606 678585 > > > > -- cu Wolfram --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
