Skip to content

Instantly share code, notes, and snippets.

View tonio's full-sized avatar
🏔️

Antoine Abt tonio

🏔️
View GitHub Profile
@tonio
tonio / keybase.md
Created February 10, 2017 08:27
keybase.md

Keybase proof

I hereby claim:

  • I am tonio on github.
  • I am tonio (https://keybase.io/tonio) on keybase.
  • I have a public key whose fingerprint is C190 CB88 6122 9827 9B72 CB1F 0176 CDE7 C3C8 D75C

To claim this, I am signing this object:

from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import *
from sqlalchemy.orm import sessionmaker, relationship
Base = declarative_base()
class AB(Base):
__tablename__= 'ab'
id_a = Column(Integer, ForeignKey('a.id', ondelete='CASCADE'), primary_key=True)
id_b = Column(Integer, ForeignKey('b.id', ondelete='CASCADE'), primary_key=True)
rel = Column(Unicode)
@tonio
tonio / mapping.vim
Created June 26, 2012 12:55
know vim mappings
:new
:redir @"
:verbose map
:map!
:redir END
p
@tonio
tonio / diff.patch
Created June 11, 2012 14:58
FormAlchemy with model inheritance
diff --git a/formalchemy/tests/__init__.py b/formalchemy/tests/__init__.py
index 7dcacd9..c9c9d6c 100644
--- a/formalchemy/tests/__init__.py
+++ b/formalchemy/tests/__init__.py
@@ -80,6 +80,18 @@ class One(Base):
__tablename__ = 'ones'
id = Column(Integer, primary_key=True)
+class Root(Base):
+ __tablename__ = 'root'
@tonio
tonio / sqla.py
Created March 28, 2012 09:32
Sqlalchemy association_proxy error
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import *
from sqlalchemy.orm import sessionmaker, relationship
from sqlalchemy.ext.associationproxy import association_proxy
Base = declarative_base()
class A(Base):
__tablename__ = 'a'
id = Column(Integer, primary_key=True)
@tonio
tonio / build.sh
Created June 7, 2011 09:40
build javascript on changes with buildout & nosier
buildout/bin/nosier -p project/public/js "buildout/bin/buildout install jsbuild"
# save posted image in sqlalchemy LargeBinary
revision.image = request.params.get('image').file.read()
Ext.getBody().createChild({
tag: 'script',
src: Ext.urlAppend(
'http://localhost:5000/pois',
Ext.urlEncode({
ids: Array.prototype.slice.call(arguments).join(','),
callback: callback
})
)
});
in_filter = Poi.id_point.in_(map(int, request.params['ids'].split(',')))