Re: Bug: Manually changing "_meta.db_table" for model causes "missing FROM-clause entry for table" error

2017-07-13 Thread Guilherme Leal
I don't think that sould be possible to change real table name "on the fly". If I'm not mistaken, that kind of attribute is used by model's meta class during class creation process to populate the django model cache, which in turn only occurs during the django configuration step. 2017-07-13 14:08

Re: Bug: Manually changing "_meta.db_table" for model causes "missing FROM-clause entry for table" error

2017-07-13 Thread Kalvin Handilist
Hi I encounter same problem as your, do you already got the solution? Any help will be appreciated, thank you~ On Saturday, November 14, 2015 at 1:40:21 AM UTC+7, evil...@gmail.com wrote: > > Hello. > I've got the same model in two projects and want to copy data from one to > another using model

Re: Bug: Manually changing "_meta.db_table" for model causes "missing FROM-clause entry for table" error

2015-11-15 Thread James Schneider
On Sun, Nov 15, 2015 at 12:04 AM, wrote: > Thanks for the answer. > What do you suggest to use instead of this ugly method, raw sql? > Would it make sense to serialize a ModelDatabaseA object (perhaps into JSON or a standard Python dict) and use that to populate/create a ModelDatabaseB object, s

Re: Bug: Manually changing "_meta.db_table" for model causes "missing FROM-clause entry for table" error

2015-11-15 Thread evilejik
Thanks for the answer. What do you suggest to use instead of this ugly method, raw sql? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@

Re: Bug: Manually changing "_meta.db_table" for model causes "missing FROM-clause entry for table" error

2015-11-15 Thread evilejik
Thanks for the answer. What do you suggest to use instead of this ugly method, raw sql? суббота, 14 ноября 2015 г., 17:59:51 UTC+3 пользователь Tim Graham написал: > > I'm not sure that type of monkeypatching of Model._meta.db_table is meant > to be supported. You could try to bisect Django's com

Re: Bug: Manually changing "_meta.db_table" for model causes "missing FROM-clause entry for table" error

2015-11-14 Thread Tim Graham
I'm not sure that type of monkeypatching of Model._meta.db_table is meant to be supported. You could try to bisect Django's commit history to find the commit that changed the behavior. My guess it that it might have to do with some internal caching such that your monkeypatch no longer has any e

Bug: Manually changing "_meta.db_table" for model causes "missing FROM-clause entry for table" error

2015-11-13 Thread evilejik
Hello. I've got the same model in two projects and want to copy data from one to another using model meta 'db_table' option: my_model_original_table_name = MyModel._meta.db_table MyModel._meta.db_table = 'old_project_table_name' old_objects = MyModel.objects.using('old_project_data_base').valu