On 12/8/05, braver <[EMAIL PROTECTED]> wrote: > I want to add a UNIQUE(<fields>) 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 field in your model. Add "db_index=True" to the appropriate field to add an index. Then run "django-admin.py sqlindexes appname" to get the CREATE INDEX statements. > Also -- can a ForeignKey be supplied with a human-readable name, like > other fields? Yes, give it a "verbose_name='foo'" parameter. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org