For anyone wondering how to do this p = Product() p.site_id = 1 p.name = 'An Example Product 3' p.description = 'feel free to delete this product record' p.save()
c = Product.objects.filter(name='Category Name').get() p.category.add(c) p.save() On Jul 22, 1:09 pm, Brian Lee <[email protected]> wrote: > Thank you Stuart for your help. I appreciate it. > > Another question, how would I set the Category for the product? > > It doesnt seem to like p.category = 'Bedroom' or p.category = 2 > > Brian > > On Jul 22, 12:42 pm, Stuart Laughlin <[email protected]> wrote: > > > > > On Thu, Jul 22, 2010 at 11:33 AM, Brian Lee <[email protected]> wrote: > > > > How would I relate this script to my store so that I can run it in the > > > form of python productimport.py instead of using python console > > > I think the easiest way is to set your DJANGO_SETTINGS_MODULE > > environment variable. > > > Here's an article that helped me with this > > topic:http://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/ > > > --Stuart -- You received this message because you are subscribed to the Google Groups "Satchmo users" 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/satchmo-users?hl=en.
