Skip to content

Instantly share code, notes, and snippets.

View silenius's full-sized avatar
🤘

Julien Cigar silenius

🤘
View GitHub Profile
MAP
(...)
SYMBOL
NAME "bbpf_logo"
TYPE pixmap
IMAGE "bbpf.png"
END
MAP file:
#########
LAYER
NAME "mapname"
STATUS DEFAULT
TYPE POINT
TRANSFORM ll
UNITS PIXELS
### PGSQL ###
create or replace view map_name as select id, name, now() as generated_date, st_GeomFromText('POINT(-5 70)') AS geom FROM map;
### MAPFILE ###
LAYER
NAME "mapname"
STATUS DEFAULT
TYPE POINT
jcigar@dev:~/ > pg_restore -d alienalert -O -x -t country_id_seq -t country nb.sql
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 191; 1259 3251168 TABLE country jcigar
pg_restore: [archiver (db)] could not execute query: ERROR: relation "country_id_seq" does not exist
Command was: CREATE TABLE country (
id integer DEFAULT nextval('country_id_seq'::regclass) NOT NULL,
name character varying(200) ...
pg_restore: [archiver (db)] Error from TOC entry 3663; 0 3251168 TABLE DATA country jcigar
pg_restore: [archiver (db)] could not execute query: ERROR: relation "country" does not exist
Command was: COPY country (id, name, iso_code) FROM stdin;
from datetime import date
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
Base= declarative_base()
pool_invites = Table(
create table account (
id serial not null,
constraint pk_account
primary key(id),
);
create table form (
id serial not null,
account_id integer not null,
pool_account_result_mapper = orm.mapper(
PoolAccountResult,
table['pool_invite_result'],
properties = {
'result' : orm.relationship(Result,
backref='pool_account_result_assoc'),
'pool' : orm.relationship(
Pool,
primaryjoin=sql.and_(
# -*- coding: utf-8 -*-
import cherrypy
from cherrypy._cpdispatch import Dispatcher
from sqlalchemy import sql
from amnesia import db
__all__ = ['AmnesiaDispatcher']
create table account_role(
id serial not null,
account_id integer not null,
role_id integer not null,
pool_id integer,
constraint pk_account_role
primary key(id),
constraint fk_account
###########
# ACCOUNT #
###########
orm.mapper(Account, table['account'])
########
# POOL #
########