pandafy@dev-logs:~$

  • Fixing notification storm of OpenWISP Notification

    OpenWISP Notifications brought the notification functionality to OpenWISP. It provided a handy abstraction to create notifications for different events triggered in OpenWISP. Hence allowing users to stay updated on their networks. But there existed a major shortcoming of OpenWISP Notifications, the notification storm. Whenever there is an event that affects...

  • Request using bearer authentication in PHP

    Making a GET request in PHP is not as simple as doing it in Python using the request module. After looking over multiple resources over the internet I found the following code to work well. try { $curl = curl_init($); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $headers = array( "Accept:...

  • Executing Raw SQL in Django

    Django provides a way to directly execute SQL queries which is neatly described in Django documentation. This devlog summarizes my key takeaways while working with it. The Manager.raw method supports deferring unrequired fields. But it is to be noted that the primary key can’t be deferred since it is used...

  • Django Query Expressions: F()

    The F() Django query expression allows performing a database operation on a field without loading its value in memory. Using it, we can update values for not only a particular object but also for an entire queryset. To do that, we need to use F() in conjunction with the update()...

  • Deferred Fields in Django

    Django’s ORM provides a way to load only specific fields from the database using only and defer methods. The deferred fields are represented with the django.db.models.base.DEFERRED object. refresh_from_db model loads the deferred fields from the database, but it is possible to make it load only specific fields. While working on...