Posts

# def post(self,user_id=None): # params={'user_id':[b'729'],'fstname':[b'acp'],'lstname':[b'acp']} # print(type(params)) # id = params['user_id'][0].decode() # print(id) # user = self.session.query(User).filter(User.user_id==id).update(user_id=params['user_id'],fname=params['fstname'], # lname=params['lstname']) # self.session.commit(user) # return redirect('admin.html') # ################################### # def post(self, user_id=None): # params = {'user_id': [b'729'], 'fstname': [b'acp'], 'lstname': [b'acp']} # print(type(params)) # user_id = params['user_id'][0].decode() # print(user_id) # # Update the record in the database # self.session.query(User).filter(User.user_id == user_id).update(user_id=par

Git And GitHub

# for adding or initialize repository git init # check status# git status # add all folders and file # git add . # If you want add file restored from staged git staged # for git commit # git commit -m "first commit" # set main brach is main# git branch -M main # set remote origin# git remote add origin https://github.com/Akashshere19/dealerApp_kur.git # Remove origin remote git remote remove origin # push your code on git hub# git push -u origin main # push force fully when show -----> ! [rejected] main -> main (non-fast-forward) git push -f origin main # remove initializing# rm -rf .git # showing history of work git log # showing history of work git log --stat # showing history of work git log --graph # showing history of work git log --graph --oneline # switch on another branch git checkout #show set remote git remote -v or git remote -vv # show local branches and last commit git branch -v or git branch -vv # for new

Import files

 # How to import class from another file Main |-- animal_def.py |-- file.py # animal_def.py class Animal: def animalName(self,name): print('This is {}'.format(name)) # file.py from animal_def import Animal ani = Animal() im = ani.animalName('Tiger')  # How to import all classes from another folder # animal_def.py class Animal: def animalName(self,name): print('This is {}'.format(name)) class Plant: def plantName(self,name): print('this is {}'.format(name)) # file.py from animal_def import * ani = Animal() bni = Plant() im = ani.animalName('Tiger') ik = bni.plantName('Neem')  # How to import all classes from another file main |-- module |-- human_def.py |-- run.py main |-- module |-- human_def.py |-- __init__.py |-- run.py # 1st create __init__.py file in from folder # human_def.py class Animal: def animalName(self,name): print('This is {}'.forma