View Single Post
AI_
Member
Join Date: Oct 2014
Location: Canada
Old 10-22-2017 , 06:11   Re: [TF2] TF2 Item DB (replaces tf2itemsinfo)
Reply With Quote #142

I generated my sqlite db above using flaminsarge's version straight off his Github page. The only change I had to do in tf2db.py was to add a null check for the item name at line 183 before the execute:

Code:
if i.get('item_name') is None:
    continue

dbc.execute('INSERT INTO new_tf2idb_item ' # ...
Alternatively, you can remove NOT NULL from the table definition on line 78:

Code:
dbc.execute('CREATE TABLE "new_tf2idb_item" ('
    '"id" INTEGER PRIMARY KEY NOT NULL,'
    '"name" TEXT NOT NULL,'
    '"item_name" TEXT,'   #  <---  Right here  
    '"class" TEXT NOT NULL,'
    '"slot" TEXT,'
    '"quality" TEXT NOT NULL,'
    '"tool_type" TEXT,'
    '"min_ilevel" INTEGER,'
    '"max_ilevel" INTEGER,'
    '"baseitem" INTEGER,'
    '"holiday_restriction" TEXT,'
    '"has_string_attribute" INTEGER,'
    '"propername" INTEGER'
    ')'
)
__________________

Last edited by AI_; 10-22-2017 at 06:24.
AI_ is offline