¡@

Home 

python Programming Glossary: db

How can I login to django using tastypie

http://stackoverflow.com/questions/11770501/how-can-i-login-to-django-using-tastypie

username is not unique . I only have one username in the db and it's the user I am trying to authenticate. Any ideas as..

python: How to add property to a class dynamically?

http://stackoverflow.com/questions/1325673/python-how-to-add-property-to-a-class-dynamically

The goal is to create a mock class which behaves like a db resultset. So for example if a database query returns using..

Whether to use “SET NAMES”

http://stackoverflow.com/questions/1650591/whether-to-use-set-names

put SET NAMES utf8 on the top of every script to let the db know that my queries are utf8 encoded. Can anyone comment the..

Sanitising user input using Python

http://stackoverflow.com/questions/16861/sanitising-user-input-using-python

As the other posters have said pretty much all Python db libraries take care of SQL injection so this should pretty much..

Django auto_now and auto_now_add

http://stackoverflow.com/questions/1737017/django-auto-now-and-auto-now-add

18 12 2009 error home ptarjan projects twitter meme django db backends mysql base.py 84 Warning Column 'created' cannot be.. self.cursor.execute query args the relevant part of my db is `created` datetime NOT NULL `modified` datetime NOT NULL..

Lost connection to MySQL server during query

http://stackoverflow.com/questions/1884859/lost-connection-to-mysql-server-during-query

was. This is basically the code I have here # import MySQLdb class DB conn None def connect self self.conn MySQLdb.connect.. MySQLdb class DB conn None def connect self self.conn MySQLdb.connect 'hostname' 'user' ' ' 'some_table' cursorclass MySQLdb.cursors.SSCursor.. 'hostname' 'user' ' ' 'some_table' cursorclass MySQLdb.cursors.SSCursor def query self sql try cursor self.conn.cursor..

Django + MySQL on Mac OS 10.6.2 Snow Leopard

http://stackoverflow.com/questions/1904039/django-mysql-on-mac-os-10-6-2-snow-leopard

validation.py line 22 in get_validation_errors from django.db import models connection File Library Frameworks Python.framework.. Versions 2.6 lib python2.6 site packages django db __init__.py line 41 in module backend load_backend settings.DATABASE_ENGINE.. Versions 2.6 lib python2.6 site packages django db __init__.py line 17 in load_backend return import_module '.base'..

Use only some parts of Django?

http://stackoverflow.com/questions/302651/use-only-some-parts-of-django

improve this question I myself use Django for its object db mapping without using its urlconfigs. Simply create a file called.. any Django modules. This will let you use Django's object db mappings without actually having a Django project so you can..

What are some good Python ORM solutions? [closed]

http://stackoverflow.com/questions/53428/what-are-some-good-python-orm-solutions

implement using Python that then speaks to the PostgreSQL db via an ORM JSON to the browser . I'm also looking at Django..

Using only the DB part of Django

http://stackoverflow.com/questions/579511/using-only-the-db-part-of-django

a number of these methods don't allow for using the syncdb command which is required to create the tables for your models... files. It is possible to roll your own solution to use syncdb without a settings.py but it requires some advanced knowledge.. knowledge of Django. Of course you don't need to use syncdb the tables can be created independently of the models. But it..

Python mysqldb: Library not loaded: libmysqlclient.18.dylib

http://stackoverflow.com/questions/6383310/python-mysqldb-library-not-loaded-libmysqlclient-18-dylib

mysqldb Library not loaded libmysqlclient.18.dylib I just compiled.. I just compiled and installed mysqldb for python 2.7 on my mac os 10.6. I created a simple test file.. I created a simple test file that imports import MySQLdb as mysql Firstly this command is red underlined and the info..

SQLite Performance Benchmark — why is :memory: so slow…only 1.5X as fast as disk?

http://stackoverflow.com/questions/764710/sqlite-performance-benchmark-why-is-memory-so-slow-only-1-5x-as-fast-as-d

of the same table. I then run random queries on both dbs returning sets of size approx 300k. I expected the memory based.. 1.5X speedups. I experimented with several other sizes of dbs and query sets the advantage of memory does seem to go up as.. of memory does seem to go up as the number of rows in the db increases. I'm not sure why the advantage is so small though..

What do I need to read Microsoft Access databases using Python?

http://stackoverflow.com/questions/853370/what-do-i-need-to-read-microsoft-access-databases-using-python

I've used PYODBC to connect succesfully to an MS Access db on Windows though. Install was easy usage is fairly simple you..

Use Django ORM as standalone [duplicate]

http://stackoverflow.com/questions/937742/use-django-orm-as-standalone

modules.py file Can I create a new models.py and run syncdb to have it automatically setup the tables and relationships.. the process clarifying the organization of the files e.g. db __init__.py settings.py myScript.py orm __init__.py models.py.. postgresql_psycopg2 DATABASE_HOST localhost DATABASE_NAME dbName DATABASE_USER user DATABASE_PASSWORD pass DATABASE_PORT..

How to save a Python interactive session?

http://stackoverflow.com/questions/947810/how-to-save-a-python-interactive-session

would like. Is there a way to save my input into the shell db connections variable assignments little for loops and bits of..

How to generate all permutations of a list in Python

http://stackoverflow.com/questions/104420/how-to-generate-all-permutations-of-a-list-in-python

None # permutations 'ABCD' 2 AB AC AD BA BC BD CA CB CD DA DB DC # permutations range 3 012 021 102 120 201 210 pool tuple..

Choosing Java vs Python on Google App Engine

http://stackoverflow.com/questions/1085898/choosing-java-vs-python-on-google-app-engine

no threads no custom class loaders no JNI no relational DB to hamper the simple reuse of existing Java libraries as much..

Django persistent database connection

http://stackoverflow.com/questions/1125504/django-persistent-database-connection

connection Or speed up connection from python to DB Thanks in advance. python database django mod wsgi persistent..

How can I login to django using tastypie

http://stackoverflow.com/questions/11770501/how-can-i-login-to-django-using-tastypie

you are authenticating with. This will bubble up at the DB layer as you've noticed that such a user already exists. What..

Python: is using “..%(var)s..” % locals() a good practice?

http://stackoverflow.com/questions/1550479/python-is-using-vars-locals-a-good-practice

variable only exists because it's been fetched from a DB or the like so keeping it or some other local around is not..

Lost connection to MySQL server during query

http://stackoverflow.com/questions/1884859/lost-connection-to-mysql-server-during-query

is basically the code I have here # import MySQLdb class DB conn None def connect self self.conn MySQLdb.connect 'hostname'.. self.conn.cursor cursor.execute sql return cursor # # db DB sql SELECT bla FROM foo data db.query sql for row in data do_something..

Simple implementation of N-Gram, tf-idf and Cosine similarity in Python

http://stackoverflow.com/questions/2380394/simple-implementation-of-n-gram-tf-idf-and-cosine-similarity-in-python

in Python I need to compare documents stored in a DB and come up with a similarity score between 0 and 1. The method..

Django equivalent for count and group by

http://stackoverflow.com/questions/327807/django-equivalent-for-count-and-group-by

when setting .query.group_by the values must be actual DB column names 'category_id' not Django field names 'category'..

How to serialize SqlAlchemy result to JSON?

http://stackoverflow.com/questions/5022066/how-to-serialize-sqlalchemy-result-to-json

good automatic serialization of ORM models returned from DB to JSON format. How to serialize SQLAlchemy query result to..

Using only the DB part of Django

http://stackoverflow.com/questions/579511/using-only-the-db-part-of-django

only the DB part of Django Does somebody know how modular is Django Can.. Can I use just the ORM part to get classes that map to DB tables and know how to read write from these tables If not what.. Secondly consider how you would create your queries to the DB with the standard Model.objects.filter call. If this is done..

MySQL — Joins Between Databases On Different Servers Using Python?

http://stackoverflow.com/questions/5832787/mysql-joins-between-databases-on-different-servers-using-python

it programatically in python I am using python 's MySQLDB to separately interact with each one of the databases . python.. Storage Engine . Workaround it is possible to use another DBMS to retrieve data between two databases for example you could..

Creating a logging handler to connect to Oracle?

http://stackoverflow.com/questions/935930/creating-a-logging-handler-to-connect-to-oracle

to me is to move said logging to text files to an oracle DB. The tables have already been defined and where things need.. at adding another logging handler that will log to the DB. I am using python 2.5.4 and cx_Oracle and the applications.. every so often. Below is an example which uses mx.ODBC you can probably adapt this to cx_Oracle without too much trouble...

Use Django ORM as standalone [duplicate]

http://stackoverflow.com/questions/937742/use-django-orm-as-standalone

Duplicates Use only some parts of Django Using only the DB part of Django I want to use the Django ORM as standalone. Despite..

How to implement band-pass Butterworth filter with Scipy.signal.butter

http://stackoverflow.com/questions/12093594/how-to-implement-band-pass-butterworth-filter-with-scipy-signal-butter

the digital frequency where the filter response is 3 dB less than the passband. wp is a tuple containing the stop band.. gpass is the maximum attenutation in the passband in dB while gstop is the attentuation in the stopbands. Say for example.. 4000. Now lets say you wanted the stopbands to be down 30 dB 100 Hz from the corner frequencies. Thus your stopbands would..

How to use numpy with portaudio to extract bass, mid treble

http://stackoverflow.com/questions/1794010/how-to-use-numpy-with-portaudio-to-extract-bass-mid-treble

on the filter order the signal will be attenuated by 6 dB oct 1st order 12 dB oct 2nd order 18 dB oct 3rd order etc. For.. the signal will be attenuated by 6 dB oct 1st order 12 dB oct 2nd order 18 dB oct 3rd order etc. For your application.. be attenuated by 6 dB oct 1st order 12 dB oct 2nd order 18 dB oct 3rd order etc. For your application a 2nd order design is..

Remove specific lines from a large text file in python

http://stackoverflow.com/questions/9473921/remove-specific-lines-from-a-large-text-file-in-python

file is over 100MB with over 4 million records. Range 150.0dB 64.9dBm Mobile unit 1 Base 17.19968 145.40369 999.8 Fixed unit.. over 100MB with over 4 million records. Range 150.0dB 64.9dBm Mobile unit 1 Base 17.19968 145.40369 999.8 Fixed unit 2 Mobile.. 2 Mobile 17.20180 145.29514 533.0 Latitude Longitude Rx dB Best unit 17.06694 145.23158 050.5 2 17.06695 145.23297 044.1..

split a large text (xyz) database into x equal parts

http://stackoverflow.com/questions/9612882/split-a-large-text-xyz-database-into-x-equal-parts

~10 million lines . I can use a command like sed i e '4 s dB ' e '4 s Best unit Best_Unit ' e '1 3 d' ' cygdrive c .. trc_longlands.txt cd txt_processing sed i e '4 s dB ' e '4 s Best unit Best_Unit ' e '1 3 d' 'trc_longlands.txt'..