Re: xml -> django model

2008-12-23 Thread dick...@gmail.com
thanks DR! yeah, i'm just learning python, and was fuzzy on the object model stuff. works perfect. On Dec 23, 1:09 pm, Daniel Roseman wrote: > On Dec 23, 8:11 pm, "dick...@gmail.com" wrote: > > > > > i'm working on a simple concept i'm sure others have solved, but i > > can't get it. > > > b

Re: xml -> django model

2008-12-23 Thread Daniel Roseman
On Dec 23, 8:11 pm, "dick...@gmail.com" wrote: > i'm working on a simple concept i'm sure others have solved, but i > can't get it. > > basically, given some input, i parse it, find which objects to > create, and do it. > > so with a model: > > class Foo(models.Model): >       name = models.Char

Re: xml -> django model

2008-12-23 Thread dick...@gmail.com
yeah, but that's hardcoding in the "Foo" and "name" value, where they may be dynamic. Ie, imagine the xml is today would require the python code to instantiate a Bar(date="today") class. > Does this work? > > from myproject.test.models import Foo > f = Foo(name="bar") > f.save() > > Colin --~--

Re: xml -> django model

2008-12-23 Thread Colin Bean
On Tue, Dec 23, 2008 at 12:11 PM, dick...@gmail.com wrote: > > i'm working on a simple concept i'm sure others have solved, but i > can't get it. > > basically, given some input, i parse it, find which objects to > create, and do it. > > so with a model: > > class Foo(models.Model): > name

xml -> django model

2008-12-23 Thread dick...@gmail.com
i'm working on a simple concept i'm sure others have solved, but i can't get it. basically, given some input, i parse it, find which objects to create, and do it. so with a model: class Foo(models.Model): name = models.CharField(max_length=20) and input xml of bar my view would parse t