Re: Using API to bulk populate data

2005-11-07 Thread Kevin
I'm working on a similar script to convert a legacy database. Just a hint from a tough lesson learned, you work the opposite order that OO may teach you and you save() first, then aggregate. So example: class PhoneNumber(meta.Model): number = meta.CharField() class Contact(meta.Model):

Re: Using API to bulk populate data

2005-11-07 Thread Jacob Kaplan-Moss
I do, however, see methods for **set_relatedclass** when I dir the primary class. The documentation, to the best of my knowledge, doesn't mention how to use these methods. Check out http://www.djangoproject.com/documentation/models/ many_to_many/. The basic syntax is ``obj.set_realtedclasse

Re: Using API to bulk populate data

2005-11-07 Thread wrb
Adrian Holovaty wrote: > On 11/4/05, wrb <[EMAIL PROTECTED]> wrote: > > What's the syntax to change or populate ForeignKey and ManyToMany > > fields? > > See the documentation: > > http://www.djangoproject.com/documentation/db_api/#relationships-joins > http://www.djangoproject.com/documentation/

Re: Using API to bulk populate data

2005-11-04 Thread Adrian Holovaty
On 11/4/05, wrb <[EMAIL PROTECTED]> wrote: > What's the syntax to change or populate ForeignKey and ManyToMany > fields? See the documentation: http://www.djangoproject.com/documentation/db_api/#relationships-joins http://www.djangoproject.com/documentation/models/many_to_one/ http://www.djangop