Skip to content

Instantly share code, notes, and snippets.

View y10h's full-sized avatar

Yury Yurevich y10h

  • San Francisco Bay Area
View GitHub Profile
"""Security enchancement middleware
Allows to use `public` decorator for few public views instead of
`login_required` for almost everything.
Maybe we should contribute this to Django -Alex
(c) Alex Lebedev <me@alexlebedev.com>, Februray 2009
"""
import re
@y10h
y10h / logg.py
Created October 6, 2009 12:38
Auto-naming loggers
# encoding: utf-8
"""
Logging facilities
"""
import sys
import logging
FUNC_LOGGERS = {}
MOD_LOGGERS = {}
#!/usr/bin/env python
# 2009 Yury Yurevich <anarresti@altlinux.org>, <the.pythy@gmail.com>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@y10h
y10h / dbf2sa.py
Created May 14, 2009 09:32
dbf->rdbms using ydbf and sqlalchemy
#!/usr/bin/env python
"""
Move DBF data (as single table) to RDBMS using SQLAlchemy
"""
import os
import ydbf
import sqlalchemy as sa
@y10h
y10h / db.py
Created May 4, 2009 11:41
fixture wanted
"""
db -- provides database schema
"""
import sqlalchemy as sa
metadata = sa.MetaData()
kladr = sa.Table('kladr', metadata,
sa.Column('na_me', sa.Unicode(40)),
sa.Column('socr', sa.Unicode(10)),