I'm new to django framework. I parsed data from WebAPI server to dict:
key is product buys and value is list that contains info about product. Code:
def get_best_products(self):
dict_of_items = {}
for x in range (0, self.max_range):
itemId = self.fresh_data.item[x].itemId
itemTitle = self.fresh_data.item[x].itemTitle
photoUrl = self._get_main_item_photo(x)
itemPrice = self._get_item_price(x)
dict_of_items[self.fresh_data.item[x].bidsCount] = [itemId, itemTitle, itemPrice, photoUrl]
return self._sort_parsed_item_data(dict_of_items)
def _sort_parsed_item_data(self, data):
return OrderedDict(sorted(data.items(), reverse=True, key=lambda t: t[0]))
So i have dict of sorted items by product buys with info as value.
What is best way to put this data to database? Should i build a model? And if yes how to do it? any tips? On internet i can find examples of models that allows to edit data... or "how to build mail registration".
I want to make a model that shows all the data in a table from all the auctions but i dont want to add more. I want to have only 100 records and they will be updated when a buys change. (and maybe later when i build table that table i will try to do... lets say you click on "itemID" it will take you to edit manager, where you can change what you want about that specyfic record).
Is it possible to do with django? or if i want to update just 100 records without change i should just use SQL commands, becouse it seems to be easier? All the examples i saw allows to edit data and add data.... i want to prevent it for now.
But.... Am I allowed to "play" with database without django models when i'm using this framework? That's the main question