This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.utils.translation import ugettext_lazy as _ | |
from rest_framework import serializers | |
class SomeSerializer(serializers.ModelSerializer): | |
""" | |
Demostrating How to Override DRF UniqueTogetherValidator Message | |
""" | |
class Meta: |
I hereby claim:
- I am vaibhav-jain on github.
- I am iamvaibhavjain (https://keybase.io/iamvaibhavjain) on keybase.
- I have a public key ASBgbSzYTnrZ-mIEoiD42y8fF4CMHUHMIQNfM4_qM68wyQo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytz | |
import six | |
class TimezoneField(serializers.Field): | |
def to_representation(self, obj): | |
return six.text_type(obj) | |
def to_internal_value(self, time_zone): |
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
============== | |
git commands | |
============== | |
To rename branch | |
================= | |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git push -f aws master:master | |
Total 0 (delta 0), reused 0 (delta 0) | |
remote: master | |
To dokku@ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com:omapi | |
! [remote rejected] master -> master (pre-receive hook declined) | |
error: failed to push some refs to 'dokku@ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com:omapi' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import inspect | |
from pprint import pprint | |
clsmembers = inspect.getmembers(sys.modules[__name__], inspect.isclass) | |
l = list() | |
for k, v in clsmembers: | |
l.append(k) | |
pprint(set(l)) |
NewerOlder