Archive for 2014

How to reset all table contents in django database using view.py or controller?

Sometimes we need to delete or truncate all the database tables in django project from the view.py or controller file. First of all you need to go to open the view.py and add the following code to your some functions: Modelname.objects.all().delete() Here, the Modelname is your django model Class name in Models.py. Then run the application and make sure that the control reach the line where you added the ... Full story

How to increase or decrease indentation in xcode for Finnish keyboard?

Hello guys its sometimes frustrating using xcode in different keyboards. Normally indentation in xcode can be done with the CMD + keys. Since keys are not directly present in Finnish keyboard it can be achieved from following commands: To decrease indent: CMD + ALT + 8 To increase indent: CMD + ALT + 9 Hope it helps. :) Full story

How to solve indentation error in python?

Hi guys, Today i am in mood to discuss the common indentation error in python code. We frequently get the indentation errors such as: IndentationError: unindent does not match any outer indentation level IndentationError: unexpected indent To solve this very easily just type the following code in the command line: python -m tabnanny yourfilename.py Instead of yourfilename.py use your own python file name. This command will suggest the line where the ... Full story
Copyright © 2020 Programmer to Programmer- A website for web programming and mobile application programming tutorials.
Wordpress themes