Programming

Python
Python

Latest Blog Articles

python exception handling

python exception handling

python exception handling is one of the concepts in python programming. Before start working with exceptional handling in python what is an exception ? An exception is an event which occurs while running the program which stops the program to work further. Exception also tells about the problem i...

Read more

python reading and writing files

python reading and writing files

File reading and File writing is widely used concept in python because, As we (i.e humans) are lazy we do not remember all the information so we invented the computers(i.e storage devices) to store the information. where will computers store the information? Computer always stores the information...

Read more

python writing modules and packages

python writing modules and packages

We basically write computer programs to solve the problems. Problem may be simpler or moderate one or a complex. For simple problems we can solve it with 50 to 80 lines of code. If it is the case then we can easily manage the code. But, if code grows in an amount thousands of lines then obiviousl...

Read more

python staticmethod, classmethod and instancemethod

python staticmethod, classmethod and instancemethod

We have three types of class based methods in python. They are 1.static method, 2.class method and 3.instance method. When we are working with classes we will have to deal with different types of scenarios. Based on the scenario we have to use the one of the method types. Let's get started with t...

Read more

how to add image in select options html

how to add image in select options html

we can add animage in select options in html. but, we cannot directly achieve it with the HTML alone. To display the images in the select drop-down we have to use javascript libraries. We can add an image in select options using "select2" jQuery library.

what select2 can provide us ?

...Read more

django admin custom form usage

django admin custom form usage

Django admin allows us to use custom form. In most of the cases we use default admin provided by django. But, in some cases we may need to use some validations on the model fields or we may want to skip some fields and update these fields while saving it. In this kinds of situations we can solve ...

Read more

Python working with inheritance - oop's

Python working with inheritance - oop's

Inheritance in python defined as acquiring  the properties from the parent/base class to its child classes. In reality we develop complex applications that provides  more utilities to users. In developer perspective each utility involves different modules which work together to provide ...

Read more

how to add custom views to django admin

how to add custom views to django admin

how to add custom views to django admin without actually creating the database table ? Let's talk about it. In django admin  to get the url link in the admin we have to register the model but in some cases we just need the a url with some functionality under an applicaiton. We can imple...

Read more

Python method overloading

Python method overloading

method overloading in python can be defined as writing the method in such a way that method will provide different functionality for different datatype arguments with the same method name. Programming languages like Javaand C++ implements the method overloading by defining the two methods with t...

Read more

'__enter__' and '__exit__' context managers in python

'__enter__' and '__exit__' context managers in python

__enter__ and __exit__are built in methods in python. __enter__ and __exit__ methods are also called as context manager special methods in python. You may come up with the question"what is a context manager ?". A context manager is a manager which has the ability to make avail the data withing ...

Read more

model serializers in Django Rest Framework

model serializers in Django Rest Framework

Model serializers in django rest framework are very similar to the django model forms. By using the model serializers we can reduce the effort of writing the more code for serializers. Model serializers are the shortcuts that allow us to automatically create a serializer with fields that associat...

Read more

Python object oriented programming

Python object oriented programming

Object oriented programming is one of the programming approaches in solving the problems with progamming. Python supports object oriented programming(OOP) approach. While using OOP's in  python we mostly use terms like object, class, method, etc.

Some of the principles of Object Orie...

Read more

working with select_related in django

working with select_related in django

select_related is a queryset method in Django which returns new queryset result for a Django Model. select_related is more helpful in foreign-key relationships. It is useful when we are going to use those foreign-key relationship data later in our code.  select_related is a preformance ...

Read more

using custom widgets in django

using custom widgets in django

In Django we use built-in forms. After rendering the template with form and form fields we can see the equivalent html is generated from the form fields. How Django is doing that ? Well, to generate HTML from the form fields django uses form Widgets. In some cases we need the some specific HTML f...

Read more
Read More Blog Posts