In your models.py put:
from django.db import models
@classmethod
def model_field_exists(cls, field):
try:
cls._meta.get_field(field)
return TrueIn your models.py put:
from django.db import models
@classmethod
def model_field_exists(cls, field):
try:
cls._meta.get_field(field)
return True| chore: add Oyster build script | |
| docs: explain hat wobble | |
| feat: add beta sequence | |
| fix: remove broken confirmation message | |
| refactor: share logic between 4d3d3d3 and flarhgunnstow | |
| style: convert tabs to spaces | |
| test: ensure Tayne retains clothing |
| - General | |
| [ ] The code works | |
| [ ] The code is easy to understand | |
| [ ] Follows coding conventions | |
| [ ] Names are simple and if possible short | |
| [ ] Names are spelt correctly | |
| [ ] Names contain units where applicable | |
| [ ] Enums are used instead of int constants where applicable | |
| [ ] There are no usages of 'magic numbers' | |
| [ ] All variables are in the smallest scope possible |
| --- a/platforms/android/cordova/lib/emulator.js 2018-08-08 12:34:38.000000000 +0200 | |
| +++ b/platforms/android/cordova/lib/emulator.js 2018-08-08 14:14:35.000000000 +0200 | |
| @@ -187,7 +187,7 @@ | |
| var api_level = avd.target.match(/\d+/); | |
| if (api_level) { | |
| var level = android_versions.get(api_level); | |
| - avd.target = 'Android ' + level.semver + ' (API level ' + api_level + ')'; | |
| + avd.target = 'Android ' + (level ? level.semver : '') + ' (API level ' + api_level + ')'; | |
| } | |
| } |
| ** To install Golang on Ubuntu 17.xx server ** | |
| sudo add-apt-repository ppa:gophers/archive | |
| sudo apt-get update | |
| sudo apt-get install golang-1.9-go | |
| export PATH=$PATH:/usr/lib/go-1.9/bin | |
| go version (To verify its mapped correctly, should see something like: go version go1.9.2 linux/amd64) | |
| * make a directory for your go applications, I use /home/apps/go | |
| export GOPATH=/home/apps/go | |
| (Now from inside your /home/apps/go folder you can start creating your go apps) |
| ''' | |
| 100 Doors Problem: | |
| There are 100 doors in a row that are all initially closed. | |
| You make 100 passes by the doors. | |
| The first time through, visit every door and toggle the door (if the door is closed, open it; if it is open, close it). | |
| The second time, only visit every 2nd door (door #2, #4, #6, ...), and toggle it. | |
| The third time, visit every 3rd door (door #3, #6, #9, ...), etc, until you only visit the 100th door. | |
| Task: | |
| Answer the question: what state are the doors in after the last pass? Which are open, which are closed? |
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: