· 10 years ago · Aug 28, 2016, 08:06 PM
1CREATE TABLE IF NOT EXISTS plugin_delivery_operations_menu (
2id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
3menu_option INTEGER UNSIGNED,
4codename VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_bin,
5description VARCHAR(500) CHARACTER SET utf8 COLLATE utf8_bin,
6uploaded_menu_filename_media VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_bin,
7PRIMARY KEY(id)
8)
9ENGINE=InnoDB
10DEFAULT CHARACTER SET utf8
11DEFAULT COLLATE utf8_general_ci;
12
13
14 def get_operations_dict(self):
15 self.cursor.execute("select menu_option from plugin_delivery_operations_menu")
16 queryset = self.cursor.fetchall()
17 if len(queryset) == 0:
18 return None
19 else:
20 tempdict = {}
21 for i in queryset:
22 self.cursor.execute("select description from plugin_delivery_operations_menu where menu_option = %s", i)
23 description = self.cursor.fetchone()[0]
24 tempdict[i] = description
25 return tempdict
26
27
28ValueError: '\nSelecione uma op\xc3\xa7\xc3\xa3o ou digite *Sair* :\n\n1: Card\xe1pio em formato texto.\n2: Card\xe1pio em formato imagem.\n3: Exibir/atualizar seus dados de cadastro.\n4: Fazer um pedido de entrega.\n' has type bytes, but isn't valid UTF-8 encoding. Non-UTF-8 strings must be converted to unicode objects before being added.