sql/update_db_00_03_to_00_04.2.py
author cavaliet
Fri, 12 Aug 2011 14:44:04 +0200
branchgroup_management
changeset 130 1cc949de2d1f
parent 24 57a2650a7f87
permissions -rw-r--r--
Useless code removed. Iri group finally removed from the model. User's templates cleaned. Little css changed for home.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
#! /usr/bin/env python
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
from django.core.management import setup_environ
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
from ldtplatform import settings
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
setup_environ(settings)
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
from ldt.ldt_utils.models import Media
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
for media in Media.objects.all():
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
    mimetype = media.mimetype
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
    if not media.mimetype_field and mimetye:
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
        media.mimetype_field = minetype
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
        media.save()