You have installed GPG, then tried to commit and suddenly you see this error message after it:
error: gpg failed to sign the data
fatal: failed to write commit object
Debug
========================= | |
Join promotion in the ORM | |
========================= | |
[NOTE: We need better terms than promote and demote for changing the join | |
type. These terms are extremely easy to mix up. Maybe the ORM methods could | |
be to_inner_joins and to_louter_joins instead of promote_joins and demote_joins? | |
I tried to clean up the mis-usages of promotion/demotion but there could still | |
be some cases where these are mixed up] |
Good article also here: http://pankrat.github.io/2015/django-migrations-without-downtimes/
The following instructions describe a set of processes allowing you to run Django database migrations against a production database without having to bring the web service down.
Note that in the below instructions, migrations are all run manually at explicit points, and are not an automatic part of the deployment process.
from sqlalchemy import create_engine | |
from sqlalchemy.orm import Session | |
from myapp.models import BaseModel | |
import pytest | |
@pytest.fixture(scope="session") | |
def engine(): | |
return create_engine("postgresql://localhost/test_database") |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
# Greatest common divisor of 1 or more numbers. | |
from functools import reduce | |
def gcd(*numbers): | |
""" | |
Return the greatest common divisor of 1 or more integers | |
Examples | |
-------- |