Tagged Questions
0
votes
0answers
11 views
Created table on heroku postgres dev but while inserting it says table doesn't exist
Here is my python code to insert data in to heroku postgresql data store.
import os
from flask import Flask
import psycopg2
app = Flask(__name__)
@app.route('/')
def hello():
try:
conn ...
0
votes
0answers
26 views
Simple insert, select on postgres using python flask on heroku
I'm using python flask on heroku. I'm just running a small script in my code and had a requirement to save an id in a table and retrieve it when required.Since i'm not using any django framework or ...
0
votes
1answer
19 views
Error trying to insert data into postgres using flask python on heroku
Here is my python code hosted on heroku
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = ...
-2
votes
0answers
16 views
postgresql.CIDR and sqlalchemy [closed]
SELECT net FROM nets WHERE net >> '10.0.0.0/8'
How to convert this sql-code to sqlalchemy? 'net' has type CIDR in postgres. Is it possible?
0
votes
1answer
26 views
Django 1.5 : OperationalError in windows when running “python manage.py syncdb” using postgresql-psycopg2
This is my settings.py file in my Django project. OS : Windows, hosting : localhost
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': ...
0
votes
0answers
22 views
Django slowdown - thousands of unused datababase calls
I have a weird issue with a database consisting of about 27,000 items in the main table, and ~400,000 items in a many-to-many linking those items. The database is a Postgresql, running from Psycopg2, ...
1
vote
1answer
32 views
Change UUID format in Django foreign key
I have postgresql DB and using UUID as PK in my models.
When I do something like
model.rel_model.id
it returns me uuid in 32 chars (without '-' separators, as uuid.hex does) - it so because I wrote ...
1
vote
0answers
30 views
django orm search with postgres
For small searches in PostgreSQL, http://django-orm.readthedocs.org/en/latest/orm-pg-fulltext.html can be used easily, as shown in the docs.
Following are the steps, I used to implement it -
...
2
votes
2answers
20 views
sqlalchemy: How do I enforce date range on column?
Here is how my column looks
financial_day_of_month = Column('financial_day_of_month', Integer,
nullable=False, default=1)
I want to enforce that min=1 and max=31 ...
0
votes
0answers
18 views
open existing postgresql store
I'm trying to write an RDF graph and store it on postgresql (using pythons rdflib). I do this by opening the store which I have already created and opening a graph through this store. This process ...
2
votes
2answers
35 views
Get single value from PostgreSQL row object using SQLAlchemy
I am using Python with SQLAlchemy (and GeoAlchemy in my particular case), and I have a query that results in a single column of row objects. I wish to extract particular values from these row objects, ...
0
votes
2answers
61 views
Relationship between fields - classes OpenErp
I need to relate a field first declared on product.py to a custom module i'm making.
The fields are in the product.product class as follows:
_name = "product.product"
_description = "Product"
_table ...
3
votes
1answer
80 views
How does PostgreSQL PL/Python compare with Python outside it in terms of performances?
I run the exact same Python function, one as a PostgreSQL PL/Python, and the other one outside PostgreSQL as a usual Python script.
Surprisingly, when I call the PostgreSQL PL/Python using select * ...
0
votes
0answers
29 views
postgresql 9 plpython2.dll not found
I am trying to enable PL/Python2 in my postgresql database. My setup is as follows
windows 7 64-bit
postgresql 9.2 64-bit
In the \lib folder i have plpython3.dll but no plpython2.dll which I need ...
0
votes
1answer
45 views
Should I delete or set a variable to “deleted” in django/postgresql?
Specifically for my app, I have created this model in order to allow a user (the user_parent) to follow other users.
class Follow(models.Model):
user_parent = models.ForeignKey(User, unique=True, ...