Thanks for your reply, I haven't described the tables (or how) as I am still trying to rationalise the best approach. Perhaps if I describe to you want I want to do you'll see the best approach.
Consider the case of a shop (for example) and items can be added to the shop and their prices continually updated with a date stamp (although you want to keep the historical prices), but if an item is discontinued you do not want to remove its historical prices from the table. My thinking (which could be wrong) was to generate a table per item but if I am understanding your suggestion correctly one can add an extra column within an existing table (and then I assume have another table for date stamps, or two columns in the original table). In either case, how would you go about adding columns and have django deal with the change in table structure? Thanks, David On Sep 3, 10:25 pm, Ned Batchelder <[EMAIL PROTECTED]> wrote: > Django won't deal well with dynamically-generated tables, as it maps > classes to tables, so you'd need dynamically-generated classes, and then > code that could use those classes. This is the way all ORMs work. > > You haven't described these tables, or how (or even why) they are being > generated. If they all have the same schema, then "dynamically > generated tables" means you are going against the grain of a relational > database. You will likely be much happier adding one more column to > your table and using one statically defined table to hold all of the data. > > --Ned.http://nedbatchelder.com > > > > David wrote: > > Hi, > > > I am still learning django and was wondering on the following > > question > > as to how one would go about doing it in the django framework: > > If I have a cron job that dynamically creates new tables that are > > spawned out of new entries in a main table. For example Table > > 'Global' > > has a new entry 'A' this will generate a new Table called 'A' (and > > Table 'A' will be linked to its entry in 'Global') etc. > > How would one go about having django interact with this (or perhaps > > create)? actually, this leads to another question - can one have > > similar procedures to cron job's working with django? such as regular > > maintenance or in my case creation of tables due to an external > > factor. > > > thanks > > David > > -- > Ned Batchelder,http://nedbatchelder.com --~--~---------~--~----~------------~-------~--~----~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---