Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Homepage(Screen):
- def on_enter(self,*args):
- #def gotoproducts(self):
- try:
- #self.ids.screen_man.current = 'showdata'
- # getting data from real-time database
- self.firebase = firebase.FirebaseApplication('https://lexconnectionsapp-default-rtdb.firebaseio.com/', None)
- self.result = self.firebase.get('lexconnectionsapp-default-rtdb/products', None)
- # data i fetched from my database
- self.data = self.result
- products = [item for item in self.data.values()] # ignore primary key, get the inner dicts
- for product in products:
- sc = ShowCard(**product) # same as Showcard(description=product['description'],...)
- self.ids.prduct_grid.add_widget(sc)
- except Exception as error:
- print (str(error))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement