Only grab users with null usernames

This commit is contained in:
Wil Clouser 2010-09-02 19:39:29 -07:00
Родитель eb7035fa43
Коммит a6f0a144e0
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -30,11 +30,14 @@ class Command(BaseCommand):
# Doing this directly because I don't want to load 800k user objects
query = """SELECT id, firstname, lastname, nickname
FROM users
WHERE modified > %s
OR created > %s"""
WHERE
username IS NULL AND
(modified > %s
OR created > %s)"""
cursor.execute(query, [date, date])
else:
cursor.execute("SELECT id, firstname, lastname, nickname FROM users")
cursor.execute("""SELECT id, firstname, lastname, nickname FROM users
WHERE username IS NULL""")
data = cursor.fetchall()