Re: inspectdb throws "_mysql_exceptions.Warning: Can't read dir of './test/' (errno: 13)"

2009-01-30 Thread dick...@gmail.com
for some more info, i debugged it down to this line: File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/db/backends/mysql/introspection.py", line 70, in get_relations AND referenced_column_name IS NOT NULL""", [table_name]) it seems the table_name i

inspectdb throws "_mysql_exceptions.Warning: Can't read dir of './test/' (errno: 13)"

2009-01-30 Thread dick...@gmail.com
pretty basic database i created using the "polls" tutorial, and now trying to test inspectdb (which i need to run against a legacy db). (fwiw, i tried creating a test dir, and didn't help) thanks, bash-3.2$ python manage.py inspectdb # This is an auto-generated Django model module. # You'll have

ROOT_URLCONF

2008-12-31 Thread dick...@gmail.com
was looking for some info on how ROOT_URLCONF setting is supposed to be used? i am trying something very simple. i have a single django project. there are two apps. i want to run one app, call it foo, with a specific settings file, and set of urls, and bar with something else. so, with amy

specify alternative settings.py file at startup

2008-12-30 Thread dick...@gmail.com
i'm confused on the --settings option on manage.py. if i have a project call foo, i'd have in ./foo/settings.py to run: python manage.py runserver 8080 let's say i have a bar.settings.py which contains different values (like test database to use or something), i'm trying to run: python manage.

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

django deserialize and save new model object from xml

2008-12-23 Thread dick...@gmail.com
looking at the serialization serializers, is is possible to save "new" instance of a model object represented in xml? i'm getting an error: node is missing the 'pk' attribute, but basically, there isn't one, because i don't want the object retrieved from the db, i want to instantiate it from th

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 --~--

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

dynamically instantiate a model at run time

2008-12-23 Thread dick...@gmail.com
i'm trying to do some instantiation of models, based on run time parameters. i'm new to django/python so not sure the term, but the relative java term is reflection. for example, if i have a model, in my django models.py: class Foo(models.Model): name = models.CharField(max_length=20) now i