On Thu, Feb 26, 2009 at 4:24 AM, knight <alexar...@gmail.com> wrote:
>
> Hi,
>
> I'm using postgres database in my Django application.
> Is there a way to check if the database is empty from my models.py? (I
> mean before the first syncdb)

There isn't a simple 'is_my_database_empty' command that returns
true/false. However, inspect_db will try to produce Django models for
any existing tables in a database. If inspectdb doesn't produce any
models, then your database is probably empty.

The other way is to use the postgres prompt; running \dp at a postgres
prompt will show you all the tables that are in your database. That
will give you some indication of what models (if any) have already
been synchronized.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to