Re: indexes on tables

2005-12-09 Thread Adrian Holovaty
On 12/9/05, braver <[EMAIL PROTECTED]> wrote: > Basically, if I stuff data into the database as defined by > django-admin.py sql app, via an external loader, and then open it in > django, will I see proper objects -- or there's more to objects stored > in django's own tables, and I have to load th

Re: indexes on tables

2005-12-09 Thread braver
Basically, if I stuff data into the database as defined by django-admin.py sql app, via an external loader, and then open it in django, will I see proper objects -- or there's more to objects stored in django's own tables, and I have to load them via django calls?

Re: indexes on tables

2005-12-09 Thread Adrian Holovaty
On 12/9/05, braver <[EMAIL PROTECTED]> wrote: > unique_together = (("key","date",...),) > > Is it the way? It creates proper SQL. What about indexes on several > columns? Yes, that's the way to do multiple unique fields. There's no way to do indexes across several columns -- you can do

Re: indexes on tables

2005-12-09 Thread braver
OK. In addition, I need UNIQUE with several fields in a list. I've found the following way to do it: class Log(meta.Model): key = ... date = ... class META: unique_together = (("key","date",...),) Is it the way? It creates proper SQL. What about indexes on several columns

Re: indexes on tables

2005-12-08 Thread Adrian Holovaty
On 12/8/05, braver <[EMAIL PROTECTED]> wrote: > I want to add a UNIQUE() contraint to a table, and create extra > indexes on tables. Should I just go ahead and do it in SQL, or there's > a python way to specify such extras? Add "unique=True" to the appropriate fiel

indexes on tables

2005-12-08 Thread braver
I want to add a UNIQUE() contraint to a table, and create extra indexes on tables. Should I just go ahead and do it in SQL, or there's a python way to specify such extras? Also -- can a ForeignKey be supplied with a human-readable name, like other fields?