Changeset 9183 for src/django_gheat/gheat/management
- Timestamp:
- May 12, 2011, 8:35:35 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/gheat/management/commands/import_droidstumbler.py
r9182 r9183 91 91 # Make sure to include closing newline 92 92 if show_progres: output.write("%s\n" % meting_count) 93 94 # Bulk Import data if possible 93 95 if bulk_import: 94 sql = "INSERT INTO gheat_meting (`meetrondje_id`, `accespoint_id`, `lat`, `lng`, `signaal`) VALUES %s" % ','.join(sql_values) 95 cursor.execute(sql) 96 transaction.commit_unless_managed() 96 if len(sql_values) == 0: 97 logging.warn("No data to import") 98 else: 99 try: 100 sql = "INSERT INTO gheat_meting (`meetrondje_id`, `accespoint_id`, `lat`, `lng`, `signaal`) VALUES %s" % ','.join(sql_values) 101 cursor.execute(sql) 102 transaction.commit_unless_managed() 103 except IntegrityError, e: 104 logging.error("Unable to import - %s" % e) 105 pass 97 106 98 107 return (len(ap_cache), new_ap_count, meting_count, len(meting_pool) - meting_count)
Note:
See TracChangeset
for help on using the changeset viewer.