Posts

how to pass data from One component to other component

https://www.smashingmagazine.com/2020/01/data-components-vue-js/#propos-share-data-parent-child

How to integrate google Custom Marker Map with Vue Js Project

vuejs setup -  https://medium.com/@xon5/vue-google-maps-c16da293c71 javascrip setup -  https://developers.google.com/maps/documentation/javascript/custom-markers Custom icons link -  http://kml4earth.appspot.com/icons.html

how to Check if value already exists or not within list of dictionaries?

Example; a = [{ 'main_color' : 'red' , 'second_color' : 'blue' }, { 'main_color' : 'yellow' , 'second_color' : 'green' }, { 'main_color' : 'yellow' , 'second_color' : 'blue' }] if any ( d . get ( 'main_color' ) == 'red' for d in a ) : //if value is exit returns true else: //false

How to Dump CSV File Into Influxdb Using Python Code.

from influxdb import InfluxDBClient  import pandas as pd client = InfluxDBClient('localhost', 8086, 'root', 'root', 'dbname') file_name=open("local system file path") csv_reader=pd.read_csv(file_name) for y in csv_reader.iterrows():         sid = y [1][0]         name=         node=         nodeid = y[1][1]         sensorid = y [1][2]         status = y[1][3] json_body = [             {                 "measurement": "feeddata",                 "tags": {                         # 'name':name,                         # 'node': node,                   ...

how to write Query Parameters In Django

This is for freshers like me, Those who are strugle with how send data based on Request query params in django. TYPE-1: http://localhost:8000/api/abscs/?id=2 userid = request.query_params.get("userid") result is saved on userid= "2" TYEP-2: http://127.0.0.1:8000/aAF/?status=omn&status=aad which will correctly give you ['omn','aad'] when you use request.GET.getlist('status')

How to Add Random Password Generate In Python

import random  import string # pwd = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(8))

queryset values into list

Django values_list vs values Article.objects.values_list('id', flat=True) # flat=True will remove the tuples and return the list [1, 2, 3, 4, 5, 6] Article.objects.values('id') [{'id':1}, {'id':2}, {'id':3}, {'id':4}, {'id':5}, {'id':6}] how to convert queryset into list of values Nodes.objects.filter(id=data_id[x]['portal_node'] ).values_list('sensors', flat=True)