Kenneth, Many thanks for this! I have installed django-extensions; it looks very promising. Based on your and Josh's advice, I'm now tending to dump the codex_portfolioitem table to JSON or YAML, then use a variation of your two django-native suggestions to selectively import items back to the target pages. I'll update (probably in a week or so) as this rolls out.
with appreciation, Brygg On Wednesday, January 28, 2015 at 8:18:28 AM UTC-6, Kenneth Bolton wrote: > > Hi Brygg, > > Your understanding is correct, though in my experience more often > formulated so: > > $ python manage.py shell > > Let me take a moment to plug the excellent django-extensions module. In > your python environment, `pip install django-extensions` will download and > add the module to your python path. Mezzanine (and Cartridge) will take > advantage of this module if installed. > > $ python manage.py shell_plus > > The above command will get your python shell up and load your models for > you. It can be a huge time-saver, particularly if you are making changes > and trying to test them in the shell. > > hth! > > - ken > > On Wed, Jan 28, 2015 at 1:22 AM, Brygg Ullmer <[email protected] > <javascript:>> wrote: > >> Josh, >> >> Many thanks for the very helpful code example! Using such a variation >> (as opposed to direct SQL) does appear cleaner and more in keeping with >> Django. >> >> My apologies for the newcomer question, but -- per these links: >> >> https://docs.djangoproject.com/en/1.7/ref/django-admin/ >> https://docs.djangoproject.com/en/1.7/topics/testing/tools/ >> >> ... am I correct in understanding that Django orm scripts of the style >> you illustrate/describe may typically be accessed with a call like: >> >> python /usr/lib/python2.7/site-packages/django/bin/django-admin.py shell >> --plain --settings=./mysite.settings >> >> followed by code that begins with: >> >> from django.test import Client >> >> Warmly appreciated! >> >> Brygg >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Mezzanine Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
