mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-25 09:22:21 +00:00
Fixed a slight issue with string formatting in import_venue
This commit is contained in:
@@ -14,6 +14,7 @@ from RIGS import models
|
|||||||
import reversion
|
import reversion
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
|
||||||
def setup_cursor():
|
def setup_cursor():
|
||||||
try:
|
try:
|
||||||
cursor = connections['legacy'].cursor()
|
cursor = connections['legacy'].cursor()
|
||||||
@@ -99,7 +100,7 @@ def import_venues(delete=False):
|
|||||||
sql = """SELECT `venue`, `threephasepower` FROM `eventdetails` WHERE `venue` IS NOT NULL"""
|
sql = """SELECT `venue`, `threephasepower` FROM `eventdetails` WHERE `venue` IS NOT NULL"""
|
||||||
cursor.execute(sql)
|
cursor.execute(sql)
|
||||||
for row in cursor.fetchall():
|
for row in cursor.fetchall():
|
||||||
print("Searching for %s", row[0])
|
print(("Searching for %s", row[0]))
|
||||||
try:
|
try:
|
||||||
object = models.Venue.objects.get(name__iexact=row[0])
|
object = models.Venue.objects.get(name__iexact=row[0])
|
||||||
if not object.three_phase_available and row[1]:
|
if not object.three_phase_available and row[1]:
|
||||||
@@ -111,11 +112,13 @@ def import_venues(delete=False):
|
|||||||
object = models.Venue(name=row[0], three_phase_available=row[1])
|
object = models.Venue(name=row[0], three_phase_available=row[1])
|
||||||
object.save()
|
object.save()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# import_people()
|
# import_people()
|
||||||
# import_organisations()
|
# import_organisations()
|
||||||
# import_vat_rates()
|
# import_vat_rates()
|
||||||
import_venues(True)
|
import_venues(True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user