Advertisement
jevixlugya

Untitled

Feb 25th, 2023 (edited)
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1.     def on_enter(self):
  2.         # getting data from real-time database
  3.         self.firebase = firebase.FirebaseApplication('https://lexconnectionsapp-default-rtdb.firebaseio.com/', None)
  4.         print('connecting........')
  5.  
  6.         self.result = self.firebase.get('lexconnectionsapp-default-rtdb/products', None)
  7.         print((self.result))
  8.         # data i fetched from my database
  9.         self.data = self.result
  10.  
  11.         products = [item for item in self.data.values()]  # ignore primary key, get the inner dicts
  12.         for product in products:
  13.             sc = ShowCard(**product)  # same as Showcard(description=product['description'],...)
  14.             self.ids.show_card.add_widget(sc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement