Django | order_by query set, ascending and descending order_by() The order_by function is used to sort the result-set in ascending or descending order. Ascending Order The order_by function sorts the records in ascending order by …

Last updated 1 year, 6 months ago | 736 views

Tags:- Django

Python | Get the first 5 words from a string This can be done by using the `split()` and `join()` methods >>> massage = 'Today is a sunny day but tomorrow it might rain' >>> …

Last updated 1 year, 6 months ago | 1006 views

Tags:- Python

Django | Overriding the save method The save method is inherited from models.Model class. It is used to override the save method before storing the data in the database. This is used when there is …

Last updated 1 year, 7 months ago | 967 views

Tags:- Django

Python | Insert and Get data from an index in Elasticsearch To do so we need to import the Elasticsearch package and create an instance of that by providing the host and port. >>> from elasticsearch …

Last updated 1 year, 7 months ago | 3077 views

Tags:- Python Elasticsearch

Python | Program to count the number of words in a string split() and len() method is used to get the number of words in a string. The split() method split a string into a list …

Last updated 1 year, 7 months ago | 538 views

Tags:- Python

CSS | Gradient Text There are three different CSS properties required to add a gradient overlay to a text. background-image: <gradient> background-clip: text text-fill-color: transparent background-image: <gradient> <gradient> will replace with any gradient style which …

Last updated 1 year, 7 months ago | 539 views

Tags:- CSS

Python | Ternary Operator python uses an if-else conditional statement in a single line to represent the Ternary Operator. [true] if [expression] else [false]   Let's see an example of Ternary Operator a, b = …

Last updated 1 year, 7 months ago | 605 views

Tags:- Python

Python | Create and delete an index in Elasticsearch To use the elastic search we need to import the Elasticsearch package >>> from elasticsearch import Elasticsearch now create an object of Elasticsearch search class by providing …

Last updated 1 year, 7 months ago | 1045 views

Tags:- Python Elasticsearch

SQL | Compare timestamp with date only Timestamp holds Date and Time both with 19 characters. To filter table record with the only date parameter can be achieved by SQL DATE() function. Consider the Employee table …

Last updated 2 years, 2 months ago | 719 views

Tags:- SQL MySQL

SQL | Timestamp in where clause to select the date range Select date range from the timestamp column with where clause can be done by using the BETWEEN operator. BETWEEN Operator : The BETWEEN operator selects …

Last updated 2 years, 2 months ago | 609 views

Tags:- SQL MySQL

Django | The view account.views.register didn't return an HttpResponse object. It returned None instead. This error usually occurs when missed writing a return before render. The render is used to render the view to the browser. It …

Last updated 2 years, 2 months ago | 8236 views

Tags:- Python Django

PHP | Start array index from 1 To change the array index start from 1 instead of 0 can be done using array_unshift() and unset() function. array_unshift() Function The array_unshift() function inserts new elements to …

Last updated 2 years, 2 months ago | 4797 views

Tags:- PHP

HTML | Make an anchor tag to do nothing | href="javascript:void(0);" To prevent reloading a page when a link clicked is something like preventing the default behavior of an element. It can be achieved by providing …

Last updated 2 years, 3 months ago | 2022 views

Tags:- HTML JQuery JavaScript

HTML | Input type number maxlength not working The "maxlength" attribute of an input field is used to limit the length entered in the input field. but it works only if the type of input field …

Last updated 2 years, 3 months ago | 7425 views

Tags:- HTML JQuery JavaScript

Jquery | Remove id attribute from an element The removeAttr() function from jquery is used to removes one or more attributes from the selected elements. $("div").removeAttr("id");     Here seen an example with complete code …

Last updated 2 years, 4 months ago | 1374 views

Tags:- HTML JQuery JavaScript