System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
| # How to display only interesting fields for a Django Rest Framework API | |
| # /?fields=field1,field2,field3 | |
| from rest_framework import serializers, pagination | |
| class DynamicFieldsModelSerializer(serializers.ModelSerializer): | |
| """ | |
| A ModelSerializer that takes an additional `fields` argument that | |
| controls which fields should be displayed. |
| web: run-program gunicorn arena.wsgi | |
| celery_beat: run-program celery -A arena beat -l info | |
| celery1: run-program celery -A arena worker -Q default -l info --purge -n default_worker | |
| celery2: run-program celery -A arena worker -Q feeds -l info --purge -n feeds_worker |
| from djangobb_forum.models import Post | |
| from django.db.models import Max | |
| # id__max is None if there are no Posts in the database | |
| id_max = Post.objects.all().aggregate(Max('id'))['id__max'] | |
| id_next = id_max + 1 if id_max else 1 |
| import functools | |
| import sys | |
| import re | |
| from django.conf import settings | |
| from django.db import connection | |
| def shrink_select(sql): | |
| return re.sub("^SELECT(.+)FROM", "SELECT .. FROM", sql) | |
| def shrink_update(sql): |