Question
stringlengths
25
7.47k
Q_Score
int64
0
1.24k
Users Score
int64
-10
494
Score
float64
-1
1.2
Data Science and Machine Learning
int64
0
1
is_accepted
bool
2 classes
A_Id
int64
39.3k
72.5M
Web Development
int64
0
1
ViewCount
int64
15
1.37M
Available Count
int64
1
9
System Administration and DevOps
int64
0
1
Networking and APIs
int64
0
1
Q_Id
int64
39.1k
48M
Answer
stringlengths
16
5.07k
Database and SQL
int64
1
1
GUI and Desktop Applications
int64
0
1
Python Basics and Environment
int64
0
1
Title
stringlengths
15
148
AnswerCount
int64
1
32
Tags
stringlengths
6
90
Other
int64
0
1
CreationDate
stringlengths
23
23
I have id values for products that I need store. Right now they are all integers, but I'm not sure if the data provider in the future will introduce letters or symbols into that mix, so I'm debating whether to store it now as integer or string. Are there performance or other disadvantages to saving the values as string...
22
3
0.059928
0
false
1,090,390
0
10,684
8
0
0
1,090,022
I've just spent the last year dealing with a database that has almost all IDs as strings, some with digits only, and others mixed. These are the problems: Grossly restricted ID space. A 4 char (digit-only) ID has capacity for 10,000 unique values. A 4 byte numeric has capacity for over 4 billion. Unpredictable ID spac...
1
0
1
Drawbacks of storing an integer as a string in a database
10
python,mysql,database,database-design
0
2009-07-07T01:58:00.000
I have id values for products that I need store. Right now they are all integers, but I'm not sure if the data provider in the future will introduce letters or symbols into that mix, so I'm debating whether to store it now as integer or string. Are there performance or other disadvantages to saving the values as string...
22
37
1.2
0
true
1,090,065
0
10,684
8
0
0
1,090,022
Unless you really need the features of an integer (that is, the ability to do arithmetic), then it is probably better for you to store the product IDs as strings. You will never need to do anything like add two product IDs together, or compute the average of a group of product IDs, so there is no need for an actual num...
1
0
1
Drawbacks of storing an integer as a string in a database
10
python,mysql,database,database-design
0
2009-07-07T01:58:00.000
I have id values for products that I need store. Right now they are all integers, but I'm not sure if the data provider in the future will introduce letters or symbols into that mix, so I'm debating whether to store it now as integer or string. Are there performance or other disadvantages to saving the values as string...
22
3
0.059928
0
false
1,090,057
0
10,684
8
0
0
1,090,022
It really depends on what kind of id you are talking about. If it's a code like a phone number it would actually be better to use a varchar for the id and then have your own id to be a serial for the db and use for primary key. In a case where the integer have no numerical value, varchars are generally prefered.
1
0
1
Drawbacks of storing an integer as a string in a database
10
python,mysql,database,database-design
0
2009-07-07T01:58:00.000
I have id values for products that I need store. Right now they are all integers, but I'm not sure if the data provider in the future will introduce letters or symbols into that mix, so I'm debating whether to store it now as integer or string. Are there performance or other disadvantages to saving the values as string...
22
0
0
0
false
1,090,035
0
10,684
8
0
0
1,090,022
Integers are more efficient from a storage and performance perspective. However, if there is a remote chance that alpha characters may be introduced, then you should use a string. In my opinion, the efficiency and performance benefits are likely to be negligible, whereas the time it takes to modify your code may not ...
1
0
1
Drawbacks of storing an integer as a string in a database
10
python,mysql,database,database-design
0
2009-07-07T01:58:00.000
I have id values for products that I need store. Right now they are all integers, but I'm not sure if the data provider in the future will introduce letters or symbols into that mix, so I'm debating whether to store it now as integer or string. Are there performance or other disadvantages to saving the values as string...
22
1
0.019997
0
false
1,090,132
0
10,684
8
0
0
1,090,022
The space an integer would take up would me much less than a string. For example 2^32-1 = 4,294,967,295. This would take 10 bytes to store, where as the integer would take 4 bytes to store. For a single entry this is not very much space, but when you start in the millions... As many other posts suggest there are se...
1
0
1
Drawbacks of storing an integer as a string in a database
10
python,mysql,database,database-design
0
2009-07-07T01:58:00.000
I have id values for products that I need store. Right now they are all integers, but I'm not sure if the data provider in the future will introduce letters or symbols into that mix, so I'm debating whether to store it now as integer or string. Are there performance or other disadvantages to saving the values as string...
22
18
1
0
false
1,090,100
0
10,684
8
0
0
1,090,022
Do NOT consider performance. Consider meaning. ID "numbers" are not numeric except that they are written with an alphabet of all digits. If I have part number 12 and part number 14, what is the difference between the two? Is part number 2 or -2 meaningful? No. Part numbers (and anything that doesn't have units of m...
1
0
1
Drawbacks of storing an integer as a string in a database
10
python,mysql,database,database-design
0
2009-07-07T01:58:00.000
I am doing an application which will use multiple sqlite3 databases, prepopuldated with data from an external application. Each database will have the exact same tables, but with different data. I want to be able to switch between these databases according to user input. What is the most elegant way to do that in Turbo...
1
1
0.066568
0
false
1,422,838
0
163
2
0
0
1,093,589
I am using two databases for a read-only application. The second database is a cache in case the primary database is down. I use two objects to hold the connection, metadata and compatible Table instances. The top of the view function assigns db = primary or db = secondary and the rest is just queries against db.tableA...
1
0
0
Switching databases in TG2 during runtime
3
python,sqlite,turbogears,turbogears2
0
2009-07-07T17:14:00.000
I am doing an application which will use multiple sqlite3 databases, prepopuldated with data from an external application. Each database will have the exact same tables, but with different data. I want to be able to switch between these databases according to user input. What is the most elegant way to do that in Turbo...
1
1
0.066568
0
false
1,387,164
0
163
2
0
0
1,093,589
If ALL databases have the same schema then you should be able to create several Sessions using the same model to the different DBs.
1
0
0
Switching databases in TG2 during runtime
3
python,sqlite,turbogears,turbogears2
0
2009-07-07T17:14:00.000
My specific situation Property management web site where users can upload photos and lease documents. For every apartment unit, there might be 4 photos, so there won't be an overwhelming number of photo in the system. For photos, there will be thumbnails of each. My question My #1 priority is performance. For the e...
11
1
0.033321
0
false
1,105,534
1
7,730
4
0
0
1,105,429
a DB might be faster than a filesystem on some operations, but loading a well-identified chunk of data 100s of KB is not one of them. also, a good frontend webserver (like nginx) is way faster than any webapp layer you'd have to write to read the blob from the DB. in some tests nginx is roughly on par with memcached f...
1
0
0
storing uploaded photos and documents - filesystem vs database blob
6
python,postgresql,storage,photos,photo-management
0
2009-07-09T17:39:00.000
My specific situation Property management web site where users can upload photos and lease documents. For every apartment unit, there might be 4 photos, so there won't be an overwhelming number of photo in the system. For photos, there will be thumbnails of each. My question My #1 priority is performance. For the e...
11
9
1
0
false
1,105,444
1
7,730
4
0
0
1,105,429
File system. No contest. The data has to go through a lot more layers when you store it in the db. Edit on caching: If you want to cache the file while the user uploads it to ensure the operation finishes as soon as possible, dumping it straight to disk (i.e. file system) is about as quick as it gets. As long as the fi...
1
0
0
storing uploaded photos and documents - filesystem vs database blob
6
python,postgresql,storage,photos,photo-management
0
2009-07-09T17:39:00.000
My specific situation Property management web site where users can upload photos and lease documents. For every apartment unit, there might be 4 photos, so there won't be an overwhelming number of photo in the system. For photos, there will be thumbnails of each. My question My #1 priority is performance. For the e...
11
3
0.099668
0
false
1,105,479
1
7,730
4
0
0
1,105,429
Definitely store your images on the filesystem. One concern that folks don't consider enough when considering these types of things is bloat; cramming images as binary blobs into your database is a really quick way to bloat your DB way up. With a large database comes higher hardware requirements, more difficult repli...
1
0
0
storing uploaded photos and documents - filesystem vs database blob
6
python,postgresql,storage,photos,photo-management
0
2009-07-09T17:39:00.000
My specific situation Property management web site where users can upload photos and lease documents. For every apartment unit, there might be 4 photos, so there won't be an overwhelming number of photo in the system. For photos, there will be thumbnails of each. My question My #1 priority is performance. For the e...
11
10
1
0
false
1,105,453
1
7,730
4
0
0
1,105,429
While there are exceptions to everything, the general case is that storing images in the file system is your best bet. You can easily provide caching services to the images, you don't need to worry about additional code to handle image processing, and you can easily do maintenance on the images if needed through standa...
1
0
0
storing uploaded photos and documents - filesystem vs database blob
6
python,postgresql,storage,photos,photo-management
0
2009-07-09T17:39:00.000
We've got a healthy debate going on in the office this week. We're creating a Db to store proxy information, for the most part we have the schema worked out except for how we should store IPs. One camp wants to use 4 smallints, one for each octet and the other wants to use a 1 big int,INET_ATON. These tables are going ...
25
2
0.057081
0
false
59,109,834
0
14,213
3
0
0
1,108,918
for both ipv4 and ipv6 compatibility, use VARBINARY(16) , ipv4's will always be BINARY(4) and ipv6 will always be BINARY(16), so VARBINARY(16) seems like the most efficient way to support both. and to convert them from the normal readable format to binary, use INET6_ATON('127.0.0.1'), and to reverse that, use INET6_NTO...
1
0
0
How to store an IP in mySQL
7
python,mysql,perl,ip-address
0
2009-07-10T10:58:00.000
We've got a healthy debate going on in the office this week. We're creating a Db to store proxy information, for the most part we have the schema worked out except for how we should store IPs. One camp wants to use 4 smallints, one for each octet and the other wants to use a 1 big int,INET_ATON. These tables are going ...
25
0
0
0
false
56,818,264
0
14,213
3
0
0
1,108,918
Old thread, but for the benefit of readers, consider using ip2long. It translates ip into an integer. Basically, you will be converting with ip2long when storing into DB then converting back with long2ip when retrieving from DB. The field type in DB will INT, so you will save space and gain better performance compared...
1
0
0
How to store an IP in mySQL
7
python,mysql,perl,ip-address
0
2009-07-10T10:58:00.000
We've got a healthy debate going on in the office this week. We're creating a Db to store proxy information, for the most part we have the schema worked out except for how we should store IPs. One camp wants to use 4 smallints, one for each octet and the other wants to use a 1 big int,INET_ATON. These tables are going ...
25
3
0.085505
0
false
1,109,278
0
14,213
3
0
0
1,108,918
Having seperate fields doesn't sound particularly sensible to me - much like splitting a zipcode into sections or a phone number. Might be useful if you wanted specific info on the sections, but I see no real reason to not use a 32 bit int.
1
0
0
How to store an IP in mySQL
7
python,mysql,perl,ip-address
0
2009-07-10T10:58:00.000
HI , I made a ICAPServer (similar with httpserver) for which the performance is very important. The DB module is sqlalchemy. I then made a test about the performance of sqlalchemy, as a result, i found that it takes about 30ms for sqlalchemy to write <50kb data to DB (Oracle), i don`t know if the result is normal, or i...
1
1
1.2
0
true
1,110,990
0
4,462
2
0
0
1,110,805
I had some issues with sqlalchemy's performance as well - I think you should first figure out in which ways you are using it ... they recommend that for big data sets is better to use the sql expression language. Either ways try and optimize the sqlalchemy code and have the Oracle database optimized as well, so you can...
1
0
0
python sqlalchemy performance?
3
python,sqlalchemy
0
2009-07-10T17:16:00.000
HI , I made a ICAPServer (similar with httpserver) for which the performance is very important. The DB module is sqlalchemy. I then made a test about the performance of sqlalchemy, as a result, i found that it takes about 30ms for sqlalchemy to write <50kb data to DB (Oracle), i don`t know if the result is normal, or i...
1
1
0.066568
0
false
1,110,888
0
4,462
2
0
0
1,110,805
You can only push SQLAlchemy so far as a programmer. I would agree with you that the rest of the performance is up to your DBA, including creating proper indexes on tables, etc.
1
0
0
python sqlalchemy performance?
3
python,sqlalchemy
0
2009-07-10T17:16:00.000
I would like to insert a calculation in Excel using Python. Generally it can be done by inserting a formula string into the relevant cell. However, if i need to calculate a formula multiple times for the whole column the formula must be updated for each individual cell. For example, if i need to calculate the sum of t...
1
0
0
0
false
1,116,782
0
12,592
1
0
0
1,116,725
If you are using COM bindings, then you can simply record a macro in Excel, then translate it into Python code. If you are using xlwt, you have to resort to normal loops in python..
1
0
0
Calculating formulae in Excel with Python
6
python,excel,formula
0
2009-07-12T19:36:00.000
HI,i got a multi-threading program which all threads will operate on oracle DB. So, can sqlalchemy support parallel operation on oracle? tks!
0
1
0.099668
0
false
1,117,592
0
2,195
1
0
0
1,117,538
As long as each concurrent thread has it's own session you should be fine. Trying to use one shared session is where you'll get into trouble.
1
0
0
python sqlalchemy parallel operation
2
python,sqlalchemy
0
2009-07-13T02:44:00.000
Just starting to get to grips with python and MySQLdb and was wondering Where is the best play to put a try/catch block for the connection to MySQL. At the MySQLdb.connect point? Also should there be one when ever i query? What exceptions should i be catching on any of these blocks? thanks for any help Cheers Mark
9
1
0.099668
0
false
1,117,841
0
5,063
2
0
0
1,117,828
I think that the connections and the query can raised errors so you should have try/excepy for both of them.
1
0
0
Python MySQLdb exceptions
2
python,mysql,exception
0
2009-07-13T05:31:00.000
Just starting to get to grips with python and MySQLdb and was wondering Where is the best play to put a try/catch block for the connection to MySQL. At the MySQLdb.connect point? Also should there be one when ever i query? What exceptions should i be catching on any of these blocks? thanks for any help Cheers Mark
9
16
1.2
0
true
1,118,129
0
5,063
2
0
0
1,117,828
Catch the MySQLdb.Error, while connecting and while executing query
1
0
0
Python MySQLdb exceptions
2
python,mysql,exception
0
2009-07-13T05:31:00.000
I'm developing a web application and considering Django, Google App Engine, and several other options. I wondered what kind of "penalty" I will incur if I develop a complete Django application assuming it runs on a dedicated server, and then later want to migrate it to Google App Engine. I have a basic understanding of...
9
1
0.049958
0
false
1,118,790
1
1,845
2
1
0
1,118,761
There are a few things that you can't do on the App Engine that you can do on your own server like uploading of files. On the App Engine you kinda have to upload it and store the datastore which can cause a few problems. Other than that it should be fine from the Presentation part. There are a number of other little th...
1
0
0
Migrating Django Application to Google App Engine?
4
python,django,google-app-engine
0
2009-07-13T10:40:00.000
I'm developing a web application and considering Django, Google App Engine, and several other options. I wondered what kind of "penalty" I will incur if I develop a complete Django application assuming it runs on a dedicated server, and then later want to migrate it to Google App Engine. I have a basic understanding of...
9
8
1.2
0
true
1,119,377
1
1,845
2
1
0
1,118,761
Most (all?) of Django is available in GAE, so your main task is to avoid basing your designs around a reliance on anything from Django or the Python standard libraries which is not available on GAE. You've identified the glaring difference, which is the database, so I'll assume you're on top of that. Another difference...
1
0
0
Migrating Django Application to Google App Engine?
4
python,django,google-app-engine
0
2009-07-13T10:40:00.000
I am using Python 2.6.1, MySQL4.0 in Windows platform and I have successfully installed MySQLdb. Do we need to set any path for my python code and MySQLdb to successful run my application? Without any setting paths (in my code I am importing MySQLdb) I am getting No module named MySQLdb error is coming and I am not abl...
1
0
0
0
false
1,136,692
0
770
1
0
0
1,136,676
How did you install MySQLdb? This sounds like your MySQLdb module is not within your PYTHONPATH which indicates some inconsistancy between how you installed Python itself and how you installed MySQLdb. Or did you perhaps install a MySQLdb binary that was not targeted for your version of Python? Modules are normally put...
1
0
0
is it required to give path after installation MySQL db for Python 2.6
3
python,mysql
0
2009-07-16T10:20:00.000
Has anyone used SQLAlchemy in addition to Django's ORM? I'd like to use Django's ORM for object manipulation and SQLalchemy for complex queries (like those that require left outer joins). Is it possible? Note: I'm aware about django-sqlalchemy but the project doesn't seem to be production ready.
23
4
0.158649
0
false
1,308,718
1
12,511
3
0
0
1,154,331
Jacob Kaplan-Moss admitted to typing "import sqlalchemy" from time to time. I may write a queryset adapter for sqlalchemy results in the not too distant future.
1
0
0
SQLAlchemy and django, is it production ready?
5
python,database,django,sqlalchemy
0
2009-07-20T15:44:00.000
Has anyone used SQLAlchemy in addition to Django's ORM? I'd like to use Django's ORM for object manipulation and SQLalchemy for complex queries (like those that require left outer joins). Is it possible? Note: I'm aware about django-sqlalchemy but the project doesn't seem to be production ready.
23
19
1.2
0
true
1,155,407
1
12,511
3
0
0
1,154,331
What I would do, Define the schema in Django orm, let it write the db via syncdb. You get the admin interface. In view1 you need a complex join def view1(request): import sqlalchemy data = sqlalchemy.complex_join_magic(...) ... payload = {'data': data, ...} return render_to_re...
1
0
0
SQLAlchemy and django, is it production ready?
5
python,database,django,sqlalchemy
0
2009-07-20T15:44:00.000
Has anyone used SQLAlchemy in addition to Django's ORM? I'd like to use Django's ORM for object manipulation and SQLalchemy for complex queries (like those that require left outer joins). Is it possible? Note: I'm aware about django-sqlalchemy but the project doesn't seem to be production ready.
23
7
1
0
false
3,555,602
1
12,511
3
0
0
1,154,331
I've done it before and it's fine. Use the SQLAlchemy feature where it can read in the schema so you don't need to declare your fields twice. You can grab the connection settings from the settings, the only problem is stuff like the different flavours of postgres driver (e.g. with psyco and without). It's worth it as ...
1
0
0
SQLAlchemy and django, is it production ready?
5
python,database,django,sqlalchemy
0
2009-07-20T15:44:00.000
I'm modeling a database relationship in django, and I'd like to have other opinions. The relationship is kind of a two-to-many relationship. For example, a patient can have two physicians: an attending and a primary. A physician obviously has many patients. The application does need to know which one is which; further,...
2
0
0
0
false
1,162,884
1
358
1
0
0
1,162,877
I agree with your conclusion. I would store the physician type in the many-to-many linking table.
1
0
0
How would you model this database relationship?
3
python,database,django,database-design
0
2009-07-22T03:05:00.000
I have to get the data from a User site. If I would work on their site, I would VPN and then remote into their server using username and password. I thought getting data into my local machine than getting into their server where my work is not secured. So, I thought of using Ironpython to get data from the remote serve...
0
0
0
0
false
1,169,704
1
1,035
2
0
0
1,169,668
Data Source=xx.xx.xx.xx;Initial Catalog=;Integrated Security="SSPI" How are you connecting to SQL. Do you use sql server authentication or windows authentication? Once you know that, then if you use a DNS name or IP that will go to the server correctly, you have the instance name correct AND you have permissions on t...
1
0
0
need help on ADO.net connection string
2
.net,ado.net,ironpython,connection-string
0
2009-07-23T04:52:00.000
I have to get the data from a User site. If I would work on their site, I would VPN and then remote into their server using username and password. I thought getting data into my local machine than getting into their server where my work is not secured. So, I thought of using Ironpython to get data from the remote serve...
0
0
0
0
false
1,169,755
1
1,035
2
0
0
1,169,668
Is that user granted login abilities in SQL? If using SQL 2005, you go to Security->Logins Double click the user, and click Status. ------Edit ---- Create a file on your desktop called TEST.UDL. Double click it. setup your connection until it works. View the UDL in notepad, there's your connection string. Though I t...
1
0
0
need help on ADO.net connection string
2
.net,ado.net,ironpython,connection-string
0
2009-07-23T04:52:00.000
I'm trying to make a web app that will manage my Mercurial repositories for me. I want it so that when I tell it to load repository X: Connect to a MySQL server and make sure X exists. Check if the user is allowed to access the repository. If above is true, get the location of X from a mysql server. Run a hgweb cgi sc...
0
0
0
0
false
1,185,909
0
940
1
0
0
1,185,867
As far as you question, no, you're not likely to get php to execute a modified script without writing it somewhere, whether that's a file on the disk, a virtual file mapped to ram, or something similar. It sounds like you might be trying to pound a railroad spike with a twig. If you're to the point where you're filteri...
1
0
0
How can I execute CGI files from PHP?
3
php,python,mercurial,cgi
1
2009-07-26T23:24:00.000
I'm considering the idea of creating a persistent storage like a dbms engine, what would be the benefits to create a custom binary format over directly cPickling the object and/or using the shelve module?
5
1
0.028564
0
false
1,188,711
0
1,116
4
0
0
1,188,585
The potential advantages of a custom format over a pickle are: you can selectively get individual objects, rather than having to incarnate the full set of objects you can query subsets of objects by properties, and only load those objects that match your criteria Whether these advantages materialize depends on how yo...
1
0
0
What are the benefits of not using cPickle to create a persistent storage for data?
7
python,database,data-structures,persistence
0
2009-07-27T14:45:00.000
I'm considering the idea of creating a persistent storage like a dbms engine, what would be the benefits to create a custom binary format over directly cPickling the object and/or using the shelve module?
5
10
1.2
0
true
1,188,704
0
1,116
4
0
0
1,188,585
Pickling is a two-face coin. On one side, you have a way to store your object in a very easy way. Just four lines of code and you pickle. You have the object exactly as it is. On the other side, it can become a compatibility nightmare. You cannot unpickle objects if they are not defined in your code, exactly as they we...
1
0
0
What are the benefits of not using cPickle to create a persistent storage for data?
7
python,database,data-structures,persistence
0
2009-07-27T14:45:00.000
I'm considering the idea of creating a persistent storage like a dbms engine, what would be the benefits to create a custom binary format over directly cPickling the object and/or using the shelve module?
5
2
0.057081
0
false
1,188,679
0
1,116
4
0
0
1,188,585
Note that not all objects may be directly pickled - only basic types, or objects that have defined the pickle protocol. Using your own binary format would allow you to potentially store any kind of object. Just for note, Zope Object DB (ZODB) is following that very same approach, storing objects with the Pickle format....
1
0
0
What are the benefits of not using cPickle to create a persistent storage for data?
7
python,database,data-structures,persistence
0
2009-07-27T14:45:00.000
I'm considering the idea of creating a persistent storage like a dbms engine, what would be the benefits to create a custom binary format over directly cPickling the object and/or using the shelve module?
5
0
0
0
false
1,189,928
0
1,116
4
0
0
1,188,585
Will you ever need to process data from untrusted sources? If so, you should know that the pickle format is actually a virtual machine that is capable of executing arbitrary code on behalf of the process doing the unpickling.
1
0
0
What are the benefits of not using cPickle to create a persistent storage for data?
7
python,database,data-structures,persistence
0
2009-07-27T14:45:00.000
I'm developing an app that handle sets of financial series data (input as csv or open document), one set could be say 10's x 1000's up to double precision numbers (Simplifying, but thats what matters). I plan to do operations on that data (eg. sum, difference, averages etc.) as well including generation of say another ...
0
0
0
1
false
1,241,784
0
581
3
0
0
1,241,758
Are you likely to need all rows in order or will you want only specific known rows? If you need to read all the data there isn't much advantage to having it in a database. edit: If the code fits in memory then a simple CSV is fine. Plain text data formats are always easier to deal with than opaque ones if you can use t...
1
0
0
Store data series in file or database if I want to do row level math operations?
4
python,database,database-design,file-io
0
2009-08-06T21:58:00.000
I'm developing an app that handle sets of financial series data (input as csv or open document), one set could be say 10's x 1000's up to double precision numbers (Simplifying, but thats what matters). I plan to do operations on that data (eg. sum, difference, averages etc.) as well including generation of say another ...
0
0
0
1
false
1,241,787
0
581
3
0
0
1,241,758
What matters most if all data will fit simultaneously into memory. From the size that you give, it seems that this is easily the case (a few megabytes at worst). If so, I would discourage using a relational database, and do all operations directly in Python. Depending on what other processing you need, I would probably...
1
0
0
Store data series in file or database if I want to do row level math operations?
4
python,database,database-design,file-io
0
2009-08-06T21:58:00.000
I'm developing an app that handle sets of financial series data (input as csv or open document), one set could be say 10's x 1000's up to double precision numbers (Simplifying, but thats what matters). I plan to do operations on that data (eg. sum, difference, averages etc.) as well including generation of say another ...
0
2
1.2
1
true
1,245,169
0
581
3
0
0
1,241,758
"I plan to do operations on that data (eg. sum, difference, averages etc.) as well including generation of say another column based on computations on the input." This is the standard use case for a data warehouse star-schema design. Buy Kimball's The Data Warehouse Toolkit. Read (and understand) the star schema befo...
1
0
0
Store data series in file or database if I want to do row level math operations?
4
python,database,database-design,file-io
0
2009-08-06T21:58:00.000
I'm looking for the simplest way of using python and SQLAlchemy to produce some XML for a jQuery based HTTP client. Right now I'm using mod_python's CGI handler but I'm unhappy with the fact that I can't persist stuff like the SQLAlchemy session. The mod_python publisher handler that is apparently capable of persisting...
2
2
1.2
0
true
1,272,579
1
1,222
1
0
0
1,272,325
You could always write your own handler, which is the way mod_python is normally intended to be used. You would have to set some HTTP headers (and you could have a look at the publisher handler's source code for inspiration on that), but otherwise I don't think it's much more complicated than what you've been trying to...
1
0
0
Alternatives to mod_python's CGI handler
1
python,cgi,mod-python
1
2009-08-13T14:29:00.000
What I really like about Entity framework is its drag and drop way of making up the whole model layer of your application. You select the tables, it joins them and you're done. If you update the database scheda, right click -> update and you're done again. This seems to me miles ahead the competiting ORMs, like the mes...
2
0
0
0
false
1,325,558
1
433
1
1
0
1,283,646
I have heard iBattis is good. A few companies fall back to iBattis when their programmer teams are not capable of understanding Hibernate (time issue). Personally, I still like Linq2Sql. Yes, the first time someone needs to delete and redrag over a table seems like too much work, but it really is not. And the time t...
1
0
0
Entity Framwework-like ORM NOT for .NET
3
php,python,entity-framework,open-source
0
2009-08-16T07:03:00.000
I installed stackless pyton 2.6.2 after reading several sites that said its fully compatible with vanilla python. After installing i found that my django applications do not work any more. I did reinstall django (1.1) again and now im kind of lost. The error that i get is 500: Internal Server Error The server encounter...
0
2
1.2
0
true
1,284,586
1
672
1
0
0
1,283,856
When you install a new version of Python (whether stackless or not) you also need to reinstall all of the third party modules you need -- either from sources, which you say you don't want to do, or from packages built for the new version of Python you've just installed. So, check the repository from which you installe...
1
0
0
Stackless python stopped mod_python/apache from working
1
python,mod-wsgi,mod-python,stackless,python-stackless
0
2009-08-16T09:14:00.000
I want to write a python script that populates a database with some information. One of the columns in my table is a BLOB that I would like to save a file to for each entry. How can I read the file (binary) and insert it into the DB using python? Likewise, how can I retrieve it and write that file back to some arbitr...
15
0
0
0
false
1,294,488
0
25,537
1
0
0
1,294,385
You can insert and read BLOBs from a DB like every other column type. From the database API's view there is nothing special about BLOBs.
1
0
0
How to insert / retrieve a file stored as a BLOB in a MySQL db using python
2
python,mysql,file-io,blob
0
2009-08-18T14:50:00.000
I am working on integrating with several music players. At the moment my favorite is exaile. In the new version they are migrating the database format from SQLite3 to an internal Pickle format. I wanted to know if there is a way to access pickle format files without having to reverse engineer the format by hand. I know...
23
3
0.197375
0
false
1,296,188
0
27,544
1
0
0
1,296,162
You can embed a Python interpreter in a C program, but I think that the easiest solution is to write a Python script that converts "pickles" in another format, e.g. an SQLite database.
1
0
0
How can I read a python pickle database/file from C?
3
python,c
0
2009-08-18T20:02:00.000
I'm running Django through mod_wsgi and Apache (2.2.8) on Ubuntu 8.04. I've been running Django on this setup for about 6 months without any problems. Yesterday, I moved my database (postgres 8.3) to its own server, and my Django site started refusing to load (the browser spinner would just keep spinning). It works fo...
1
0
1.2
0
true
2,368,542
1
435
1
0
0
1,300,213
Found it! I'm using eventlet in some other code and I imported one of my modules into a django model. So eventlet was taking over and putting everything to "sleep".
1
0
0
Apache/Django freezing after a few requests
2
python,django,postgresql,apache2,mod-wsgi
0
2009-08-19T14:09:00.000
I have been working on a website using mod_python, python, and SQL Alchemy when I ran into a strange problem: When I query the database for all of the records, it returns the correct result set; however, when I refresh the page, it returns me a result set with that same result set appended to it. I get more result sets...
0
0
1.2
0
true
1,301,029
1
192
1
0
0
1,301,000
Not that I've ever heard of, but it's impossible to tell without some code to look at. Maybe you initialised your result set list as a global, or shared member, and then appended results to it when the application was called without resetting it to empty? A classic way of re-using lists accidentally is to put one in a ...
1
0
0
mod_python problem?
2
python,sqlalchemy,mod-python
0
2009-08-19T16:08:00.000
I've got Django set up to run some recurring tasks in their own threads, and I noticed that they were always leaving behind unfinished database connection processes (pgsql "Idle In Transaction"). I looked through the Postgres logs and found that the transactions weren't being completed (no ROLLBACK). I tried using the ...
59
111
1.2
0
true
1,346,401
1
10,095
1
0
0
1,303,654
After weeks of testing and reading the Django source code, I've found the answer to my own question: Transactions Django's default autocommit behavior still holds true for my threaded function. However, it states in the Django docs: As soon as you perform an action that needs to write to the database, Django produces ...
1
0
0
Threaded Django task doesn't automatically handle transactions or db connections?
1
python,database,django,multithreading,transactions
0
2009-08-20T02:26:00.000
When using Python and doing a Select statement to MYSQL to select 09 from a column the zero gets dropped and only the 9 gets printed. Is there any way to pull all of the number i.e. including the leading zero?
1
4
1.2
0
true
1,308,060
0
1,789
1
0
0
1,308,038
There's almost certainly something in either your query, your table definition, or an ORM you're using that thinks the column is numeric and is converting the results to integers. You'll have to define the column as a string (everywhere!) if you want to preserve leading zeroes. Edit: ZEROFILL on the server isn't going...
1
0
0
Python - MYSQL - Select leading zeros
5
python,mysql
0
2009-08-20T18:36:00.000
I'd like to use the Python version of App Engine but rather than write my code specifically for the Google Data Store, I'd like to create my models with a generic Python ORM that could be attached to Big Table, or, if I prefer, a regular database at some later time. Is there any Python ORM such as SQLAlchemy that would...
11
2
0.197375
0
false
11,325,656
1
5,333
1
1
0
1,308,376
Nowadays they do since Google has launched Cloud SQL
1
0
0
Do any Python ORMs (SQLAlchemy?) work with Google App Engine?
2
python,google-app-engine,sqlalchemy,orm
0
2009-08-20T19:39:00.000
I need to insert a python tuple (of floats) into a MySQL database. In principle I could pickle it and insert it as a string, but that would grant me the chance only to retrieve it through python. Alternative is to serialize the tuple to XML and store the XML string. What solutions do you think would be also possible, w...
0
3
0.197375
0
false
1,313,013
0
2,884
2
0
0
1,313,000
Make another table and do one-to-many. Don't try to cram a programming language feature into a database as-is if you can avoid it. If you absolutely need to be able to store an object down the line, your options are a bit more limited. YAML is probably the best balance of human-readable and program-readable, and it h...
1
0
0
Inserting python tuple in a MySQL database
3
python,mysql
0
2009-08-21T16:39:00.000
I need to insert a python tuple (of floats) into a MySQL database. In principle I could pickle it and insert it as a string, but that would grant me the chance only to retrieve it through python. Alternative is to serialize the tuple to XML and store the XML string. What solutions do you think would be also possible, w...
0
2
1.2
0
true
1,313,016
0
2,884
2
0
0
1,313,000
I'd look at serializing it to JSON, using the simplejson package, or the built-in json package in python 2.6. It's simple to use in python, importable by practically every other language, and you don't have to make all of the "what tag should I use? what attributes should this have?" decisions that you might in XML.
1
0
0
Inserting python tuple in a MySQL database
3
python,mysql
0
2009-08-21T16:39:00.000
To deploy a site with Python/Django/MySQL I had to do these on the server (RedHat Linux): Install MySQLPython Install ModPython Install Django (using python setup.py install) Add some directives on httpd.conf file (or use .htaccess) But, when I deployed another site with PHP (using CodeIgniter) I had to do nothing. I...
3
1
0.028564
0
false
1,314,005
1
1,978
1
0
0
1,313,989
You didn't have to do anything when deploying a PHP site because your hosting provider had already installed it. Web hosts which support Django typically install and configure it for you.
1
0
0
How can Django projects be deployed with minimal installation work?
7
python,django
0
2009-08-21T20:11:00.000
Rather than use an ORM, I am considering the following approach in Python and MySQL with no ORM (SQLObject/SQLAlchemy). I would like to get some feedback on whether this seems likely to have any negative long-term consequences since in the short-term view it seems fine from what I can tell. Rather than translate a row ...
3
8
1.2
0
true
1,319,598
0
569
2
0
0
1,319,585
That doesn't do away with the need for an ORM. That is an ORM. In which case, why reinvent the wheel? Is there a compelling reason you're trying to avoid using an established ORM?
1
0
0
Is this a good approach to avoid using SQLAlchemy/SQLObject?
3
python,sqlalchemy,sqlobject
0
2009-08-23T21:15:00.000
Rather than use an ORM, I am considering the following approach in Python and MySQL with no ORM (SQLObject/SQLAlchemy). I would like to get some feedback on whether this seems likely to have any negative long-term consequences since in the short-term view it seems fine from what I can tell. Rather than translate a row ...
3
2
0.132549
0
false
1,319,662
0
569
2
0
0
1,319,585
You will still be using SQLAlchemy. ResultProxy is actually a dictionary once you go for .fetchmany() or similar. Use SQLAlchemy as a tool that makes managing connections easier, as well as executing statements. Documentation is pretty much separated in sections, so you will be reading just the part that you need.
1
0
0
Is this a good approach to avoid using SQLAlchemy/SQLObject?
3
python,sqlalchemy,sqlobject
0
2009-08-23T21:15:00.000
I am writing a python script that will be doing some processing on text files. As part of that process, i need to import each line of the tab-separated file into a local MS SQL Server (2008) table. I am using pyodbc and I know how to do this. However, I have a question about the best way to execute it. I will be loo...
1
0
1.2
0
true
1,325,524
0
3,467
1
0
0
1,325,481
If I understand what you are doing, Python is not going to be a problem. Executing a statement inside a transaction does not create cumulative state in Python. It will do so only at the database server itself. When you commit you will need to make sure the commit occurred, since having a large batch commit may confli...
1
0
1
Importing a text file into SQL Server in Python
2
python,database,odbc,commit,bulkinsert
0
2009-08-25T00:30:00.000
I am interested in monitoring some objects. I expect to get about 10000 data points every 15 minutes. (Maybe not at first, but this is the 'general ballpark'). I would also like to be able to get daily, weekly, monthly and yearly statistics. It is not critical to keep the data in the highest resolution (15 minutes) for...
17
1
0.039979
0
false
1,335,132
0
13,739
1
0
0
1,334,813
plain text files? It's not clear what your 10k data points per 15 minutes translates to in terms of bytes, but in any way text files are easier to store/archive/transfer/manipulate and you can inspect the directly, just by looking at. fairly easy to work with Python, too.
1
0
0
What is the best open source solution for storing time series data?
5
python,database,statistics,time-series,schemaless
0
2009-08-26T13:47:00.000
I'm using Django 1.1 with Mysql 5.* and MyISAM tables. Some of my queries can take a TON of time for outliers in my data set. These lock the tables and shut the site down. Other times it seems some users cancel the request before it is done and some queries will be stuck in the "Preparing" phase locking all other queri...
7
0
0
0
false
1,500,947
1
4,741
3
0
0
1,353,206
You shouldn't write queries like that, at least not to run against your live database. Mysql has a "slow queries" pararameter which you can use to identify the queries that are killing you. Most of the time, these slow queries are either buggy or can be speeded up by defining a new index or two.
1
0
0
Django: How can you stop long queries from killing your database?
6
python,mysql,django,timeout
0
2009-08-30T06:10:00.000
I'm using Django 1.1 with Mysql 5.* and MyISAM tables. Some of my queries can take a TON of time for outliers in my data set. These lock the tables and shut the site down. Other times it seems some users cancel the request before it is done and some queries will be stuck in the "Preparing" phase locking all other queri...
7
1
1.2
0
true
1,353,862
1
4,741
3
0
0
1,353,206
Unfortunately MySQL doesn't allow you an easy way to avoid this. A common method is basically to write a script that checks all running processes every X seconds (based on what you think is "long") and kill ones it sees are running too long. You can at least get some basic diagnostics, however, by setting log_slow_qu...
1
0
0
Django: How can you stop long queries from killing your database?
6
python,mysql,django,timeout
0
2009-08-30T06:10:00.000
I'm using Django 1.1 with Mysql 5.* and MyISAM tables. Some of my queries can take a TON of time for outliers in my data set. These lock the tables and shut the site down. Other times it seems some users cancel the request before it is done and some queries will be stuck in the "Preparing" phase locking all other queri...
7
0
0
0
false
1,353,366
1
4,741
3
0
0
1,353,206
Do you know what the queries are? Maybe you could optimise the SQL or put some indexes on your tables?
1
0
0
Django: How can you stop long queries from killing your database?
6
python,mysql,django,timeout
0
2009-08-30T06:10:00.000
I have a problem reading a txt file to insert in the mysql db table, te sniped of this code: file contains the in first line: "aclaración" archivo = open('file.txt',"r") for line in archivo.readlines(): ....body = body + line model = MyModel(body=body) model.save() i get a DjangoUnicodeDecodeError: 'utf8' co...
1
5
1.2
0
true
1,355,303
1
3,312
1
0
0
1,355,285
Judging from the \xf3 code for 'ó', it does look like the data is encoded in ISO-8859-1 (or some close relative). So body.decode('iso-8859-1') should be a valid Unicode string (you don't specify what "without solution" means -- what error message do you get, and where?); if what you need is a utf-8 encoded bytestring ...
1
0
0
Latin letters with acute : DjangoUnicodeDecodeError
1
python,django,utf-8,character-encoding
0
2009-08-31T00:11:00.000
I'm building a fairly large enterprise application made in python that on its first version will require network connection. I've been thinking in keeping some user settings stored on the database, instead of a file in the users home folder. Some of the advantages I've thought of are: the user can change computers kee...
2
5
0.244919
0
false
1,365,175
0
650
4
0
0
1,365,164
One caveat might depend on where the user is using the application from. For example, if they use two computers with different screen resolutions, and 'selected zoom/text size' is one of the things you associate with the user, it might not always be suitable. It depends what kind of settings you intend to allow the use...
1
0
0
Is storing user configuration settings on database OK?
4
python,database,settings
0
2009-09-01T23:32:00.000
I'm building a fairly large enterprise application made in python that on its first version will require network connection. I've been thinking in keeping some user settings stored on the database, instead of a file in the users home folder. Some of the advantages I've thought of are: the user can change computers kee...
2
3
0.148885
0
false
1,365,176
0
650
4
0
0
1,365,164
Do you need the database to run any part of the application? If that's the case there are no reasons not to store the config inside the DB. You already mentioned the benefits and there are no downsides.
1
0
0
Is storing user configuration settings on database OK?
4
python,database,settings
0
2009-09-01T23:32:00.000
I'm building a fairly large enterprise application made in python that on its first version will require network connection. I've been thinking in keeping some user settings stored on the database, instead of a file in the users home folder. Some of the advantages I've thought of are: the user can change computers kee...
2
3
0.148885
0
false
1,365,183
0
650
4
0
0
1,365,164
It's perfectly reasonable to keep user settings in the database, as long as the settings pertain to the application independent of user location. One possible advantage of a file in the user's home folder is that users can send settings to one another. You may of course regard this as an advantage or a disadvantage :-)
1
0
0
Is storing user configuration settings on database OK?
4
python,database,settings
0
2009-09-01T23:32:00.000
I'm building a fairly large enterprise application made in python that on its first version will require network connection. I've been thinking in keeping some user settings stored on the database, instead of a file in the users home folder. Some of the advantages I've thought of are: the user can change computers kee...
2
8
1.2
0
true
1,365,178
0
650
4
0
0
1,365,164
This is pretty standard. Go for it. The caveat is that when you take the database down for maintenance, no one can use the app because their profile is inaccessible. You can either solve that by making a 100%-on db solution, or, more easily, through some form of caching of profiles locally (an "offline" mode of operati...
1
0
0
Is storing user configuration settings on database OK?
4
python,database,settings
0
2009-09-01T23:32:00.000
I am learning Python and creating a database connection. While trying to add to the DB, I am thinking of creating tuples out of information and then add them to the DB. What I am Doing: I am taking information from the user and store it in variables. Can I add these variables into a tuple? Can you please help me wit...
353
9
1
0
false
1,381,304
0
728,594
1
0
0
1,380,860
" once the info is added to the DB, should I delete the tuple? i mean i dont need the tuple anymore." No. Generally, there's no reason to delete anything. There are some special cases for deleting, but they're very, very rare. Simply define a narrow scope (i.e., a function definition or a method function in a class) a...
1
0
1
Add Variables to Tuple
8
python,tuples
0
2009-09-04T18:36:00.000
SQLite docs specifies that the preferred format for storing datetime values in the DB is to use Julian Day (using built-in functions). However, all frameworks I saw in python (pysqlite, SQLAlchemy) store the datetime.datetime values as ISO formatted strings. Why are they doing so? I'm usually trying to adapt the framew...
8
6
1
0
false
1,386,154
0
1,707
2
0
0
1,386,093
Julian Day is handy for all sorts of date calculations, but it can's store the time part decently (with precise hours, minutes, and seconds). In the past I've used both Julian Day fields (for dates), and seconds-from-the-Epoch (for datetime instances), but only when I had specific needs for computation (of dates and re...
1
0
0
Shall I bother with storing DateTime data as julianday in SQLite?
4
python,datetime,sqlite,sqlalchemy,pysqlite
0
2009-09-06T16:43:00.000
SQLite docs specifies that the preferred format for storing datetime values in the DB is to use Julian Day (using built-in functions). However, all frameworks I saw in python (pysqlite, SQLAlchemy) store the datetime.datetime values as ISO formatted strings. Why are they doing so? I'm usually trying to adapt the framew...
8
0
0
0
false
3,089,486
0
1,707
2
0
0
1,386,093
Because 2010-06-22 00:45:56 is far easier for a human to read than 2455369.5318981484. Text dates are great for doing ad-hoc queries in SQLiteSpy or SQLite Manager. The main drawback, of course, is that text dates require 19 bytes instead of 8.
1
0
0
Shall I bother with storing DateTime data as julianday in SQLite?
4
python,datetime,sqlite,sqlalchemy,pysqlite
0
2009-09-06T16:43:00.000
I have an object that is basically a Python implementation of an Oracle sequence. For a variety of reasons, we have to get the nextval of an Oracle sequence, count up manually when determining primary keys, then update the sequence once the records have been inserted. So here's the steps my object does: Construct an ...
2
2
0.132549
0
false
1,386,258
0
190
2
0
0
1,386,210
I agree that attribute access and everything that looks like it (i.e. properties in the Python context) should be fairly trivial. If a property is going to perform a potentially costly operation, use a method to make this explicit. I recommend a name like "fetch_XYZ" or "retrieve_XYZ", since "get_XYZ" is used in some l...
1
0
0
Should properties do nontrivial initialization?
3
python,properties,initialization
0
2009-09-06T17:35:00.000
I have an object that is basically a Python implementation of an Oracle sequence. For a variety of reasons, we have to get the nextval of an Oracle sequence, count up manually when determining primary keys, then update the sequence once the records have been inserted. So here's the steps my object does: Construct an ...
2
0
0
0
false
1,389,673
0
190
2
0
0
1,386,210
I've decided that the key smell in the solution I'm proposing is that the property I was creating contained the word "next" in it. Thus, instead of making a next_key property, I've decided to turn my DatabaseIntrospector class into a KeyCounter class and implemented the iterator protocol (ie making a plain old next me...
1
0
0
Should properties do nontrivial initialization?
3
python,properties,initialization
0
2009-09-06T17:35:00.000
What is the best way to use an embedded database, say sqlite in Python: Should be small footprint. I'm only needing few thousands records per table. And just a handful of tables per database. If it's one provided by Python default installation, then great. Must be open-source, available on Windows and Linus. Better...
7
0
0
0
false
1,407,345
0
5,927
1
0
0
1,407,248
Django is perfect for this but the poster is not clear if he needs to actually make a compiled EXE or a web app. Django is only for web apps. I'm not sure where you really get "heavy" from. Django is grossly smaller in terms of lines of code than any other major web app framework.
1
0
0
python database / sql programming - where to start
9
python,database,sqlite,ado
0
2009-09-10T19:31:00.000
I have started learning Python by writing a small application using Python 3.1 and py-PostgreSQL. Now I want to turn it into a web application. But it seems that most frameworks such as web-py, Django, zope are still based on Python 2.x. Unfortunately, py-PostgreSQL is incompatible with Python 2.x. Do I have to rewrite...
1
0
0
0
false
1,934,744
1
1,695
1
0
0
1,423,000
Even though it's not officially released yet, I am currently 'playing around' with CherryPy 3.2.0rc1 with Python 3.1.1 and have had no problems yet. Haven't used it with py-postgresql, but I don't see why it shouldn't work. Hope this helps, Alan
1
0
0
web framework compatible with python 3.1 and py-postgresql
4
python,web-applications,python-3.x,wsgi
0
2009-09-14T17:56:00.000
I am just starting out with the MySQLdb module for python, and upon running some SELECT and UPDATE queries, the following gets output: Exception _mysql_exceptions.OperationalError: (2013, 'Lost connection to MySQL server during query') in bound method Cursor.del of MySQLdb.cursors.Cursor object at 0x8c0188c igno...
0
0
1.2
0
true
1,439,734
0
2,148
1
0
0
1,439,616
Ha! Just realized I was trying to use the cursor after having closed the connection! In any case, it was nice writing! : ) l
1
0
0
have you seen? _mysql_exceptions.OperationalError "Lost connection to MySQL server during query" being ignored
1
python,mysql
0
2009-09-17T15:33:00.000
I have configured pgpool-II for postgres connection pooling and I want to disable psycopg2 connection pooling. How do I do this? Thanks!
0
6
1.2
0
true
1,492,172
0
1,426
1
0
0
1,440,245
psycopg2 doesn't pool connections unless you explicitely use the psycopg.pool module.
1
0
0
How do I disable psycopg2 connection pooling?
2
python,psycopg2
0
2009-09-17T17:34:00.000
I am trying to install pysqlite and have troubles with that. I found out that the most probable reason of that is missing sqlite headers and I have to install them. However, I have no ideas what these headers are (where I can find them, what they are doing and how to install them). Can anybody, pleas, help me with that...
12
0
0
0
false
1,462,623
0
17,278
2
0
0
1,462,565
pysqlite needs to compiled/build before you can use it. This requires C language header files (*.H) which come with the source code of sqllite itself. i.e. sqllite and pysqlite are two different things. Did you install sqlite prior to trying and build pysqllte ? (or maybe you did, but did you do so just with the bin...
1
0
0
What are sqlite development headers and how to install them?
3
python,header,pysqlite
0
2009-09-22T20:57:00.000
I am trying to install pysqlite and have troubles with that. I found out that the most probable reason of that is missing sqlite headers and I have to install them. However, I have no ideas what these headers are (where I can find them, what they are doing and how to install them). Can anybody, pleas, help me with that...
12
7
1
0
false
5,671,345
0
17,278
2
0
0
1,462,565
For me this worked (Redhat/CentOS): $ sudo yum install sqlite-devel
1
0
0
What are sqlite development headers and how to install them?
3
python,header,pysqlite
0
2009-09-22T20:57:00.000
I am trying to get started on working with Python on Django I am by profession a PHP developer and have been told to set up django and python on my current apache and mysql setup however I am having trouble getting the Mysqldb module for python to work, I must of followed about 6 different set of instructions, I am run...
7
7
1
0
false
6,537,345
1
7,786
1
0
0
1,465,846
On MAC OS X 10.6, Install the package as usual. The dynamic import error occurs because of wrong DYLD path. Export the path and open up a python terminal. $ sudo python setup.py clean $ sudo python setup.py build $ sudo python setup.py install $ export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH $python ...
1
0
0
Install mysqldb on snow leopard
8
python,mysql,django,osx-snow-leopard
0
2009-09-23T13:01:00.000
Can Python be used to query a SAP database?
36
4
0.113791
0
false
1,467,921
0
48,208
2
0
0
1,466,917
Sap is NOT a database server. But with the Python SAP RFC module you can query most table quite easily. It is using some sap unsupported function ( that all the world is using). And this function has some limitation on field size and datatypes.
1
0
0
Query SAP database from Python?
7
python,abap,sap-basis,pyrfc
0
2009-09-23T15:55:00.000
Can Python be used to query a SAP database?
36
1
0.028564
0
false
59,210,473
0
48,208
2
0
0
1,466,917
Python is one of the most used object-oriented programming languages which is very easy to code and understand. In order to use Python with SAP, we need to install Python SAP RFC module which is known as PyRFC. One of its available methods is RFC_READ_TABLE which can be called to read data from a table in SAP database....
1
0
0
Query SAP database from Python?
7
python,abap,sap-basis,pyrfc
0
2009-09-23T15:55:00.000
Is there a python equivalent of phpMyAdmin? Here's why I'm looking for a python version of phpmyadmin: While I agree that phpmyadmin really rocks, I don't want to run php on my server. I'd like to move from apache2-prefork to apache2-mpm-worker. Worker blows the doors off of prefork for performance, but php5 doesn't wo...
33
12
1
0
false
1,480,549
0
23,600
1
0
0
1,480,453
You can use phpMyAdmin for python project, because phpMyAdmin is meant for MySQL databases. If you are using MySQL, then regardless of whether you are using PHP or python, you can use phpMyAdmin.
1
0
0
phpMyAdmin equivalent in python?
4
python,phpmyadmin
1
2009-09-26T04:51:00.000
I'm using SQLAlchemy and I can create tables that I have defined in /model/__init__.py but I have defined my classes, tables and their mappings in other files found in the /model directory. For example I have a profile class and a profile table which are defined and mapped in /model/profile.py To create the tables I r...
3
0
0
0
false
1,483,061
0
1,155
3
0
0
1,482,627
Just import your other table's modules in your init.py, and use metadata object from models.meta in other files. Pylons default setup_app function creates all tables found in metadata object from model.meta after importing it.
1
0
0
Creating tables with pylons and SQLAlchemy
3
python,sqlalchemy,pylons
0
2009-09-27T02:19:00.000
I'm using SQLAlchemy and I can create tables that I have defined in /model/__init__.py but I have defined my classes, tables and their mappings in other files found in the /model directory. For example I have a profile class and a profile table which are defined and mapped in /model/profile.py To create the tables I r...
3
5
0.321513
0
false
1,528,312
0
1,155
3
0
0
1,482,627
I ran into the same problem with my first real Pylons project. The solution that worked for me was this: Define tables and classes in your profile.py file In your __init__.py add from profile import * after your def init_model I then added all of my mapper definitions afterwards. Keeping them all in the init file so...
1
0
0
Creating tables with pylons and SQLAlchemy
3
python,sqlalchemy,pylons
0
2009-09-27T02:19:00.000
I'm using SQLAlchemy and I can create tables that I have defined in /model/__init__.py but I have defined my classes, tables and their mappings in other files found in the /model directory. For example I have a profile class and a profile table which are defined and mapped in /model/profile.py To create the tables I r...
3
0
0
0
false
1,485,719
0
1,155
3
0
0
1,482,627
If you are using declarative style, be sure to use Base.meta for tables generation.
1
0
0
Creating tables with pylons and SQLAlchemy
3
python,sqlalchemy,pylons
0
2009-09-27T02:19:00.000
I been working on finding out how to install MySQLdb module for Python on Mac. And all pathes finally come cross to have MySQL installed since there is a mysql_config needed for the module. But I don't understand why it has to be needed? MySQLdb suppose to be a client module for the client who wants to connect to the ...
1
1
0.039979
0
false
1,483,154
0
432
3
0
0
1,483,024
What it needs is the client library and headers that come with the server, since it just a Python wrapper (which sits in _mysql.c; and DB-API interface to that wrapper in MySQLdb package) over original C MySQL API.
1
0
0
Why MySQLdb for Mac has to have MySQL installed to install?
5
python,mysql
0
2009-09-27T07:31:00.000
I been working on finding out how to install MySQLdb module for Python on Mac. And all pathes finally come cross to have MySQL installed since there is a mysql_config needed for the module. But I don't understand why it has to be needed? MySQLdb suppose to be a client module for the client who wants to connect to the ...
1
1
0.039979
0
false
1,483,030
0
432
3
0
0
1,483,024
I'm not sure about the specifics of MySQLdb, but most likely it needs header information to compile/install. It uses the location of mysql_config to know where the appropriate headers would be. The MySQL Gem for Ruby on Rails requires the same thing, even though it simply connects to the MySQL server.
1
0
0
Why MySQLdb for Mac has to have MySQL installed to install?
5
python,mysql
0
2009-09-27T07:31:00.000
I been working on finding out how to install MySQLdb module for Python on Mac. And all pathes finally come cross to have MySQL installed since there is a mysql_config needed for the module. But I don't understand why it has to be needed? MySQLdb suppose to be a client module for the client who wants to connect to the ...
1
1
0.039979
0
false
1,483,305
0
432
3
0
0
1,483,024
Just to clarify what the other answerers have said: you don't need to install a MySQL server, but you do need to install the MySQL client libraries. However, for whatever reasons, MySQL don't make a separate download available for just the client libraries, as they do for Linux.
1
0
0
Why MySQLdb for Mac has to have MySQL installed to install?
5
python,mysql
0
2009-09-27T07:31:00.000
I just upgraded the default Python 2.5 on Leopard to 2.6 via the installer on www.python.org. Upon doing so, the MySQLdb I had installed was no longer found. So I tried reinstalling it via port install py-mysql, and it succeeded, but MySQLdb was still not importable. So then I tried to python install python26 with pyth...
0
1
0.099668
0
false
2,302,542
0
1,051
1
1
0
1,499,572
You also need python_select (or is it select_python?) to change the default python used.
1
0
0
With multiple Python installs, how does MacPorts know which one to install MySQLdb for?
2
python,mysql,macos
0
2009-09-30T17:32:00.000
A quick SQLAlchemy question... I have a class "Document" with attributes "Number" and "Date". I need to ensure that there's no duplicated number for the same year, is there a way to have a UniqueConstraint on "Number + year(Date)"? Should I use a unique Index instead? How would I declare the functional part? (SQLAlc...
3
-1
-0.099668
0
false
1,510,137
0
890
1
0
0
1,510,018
I'm pretty sure that unique constraints can only be applied on columns that already have data in them, and not on runtime-calculated expressions. Hence, you would need to create an extra column which contains the year part of your date, over which you could create a unique constraint together with number. To best use t...
1
0
1
Compound UniqueConstraint with a function
2
python,sqlalchemy,constraints
0
2009-10-02T14:52:00.000
One of the feature I like in RoR is the db management, it can hide all the sql statement, also, it is very easy to change different db in RoR, is there any similar framework in Python 3000?
1
1
0.039979
0
false
1,510,491
0
614
3
0
0
1,510,084
Python 3 isn't ready for web applications right now. The WSGI 1.0 specification isn't suitable for Py3k and the related standard libraries are 2to3 hacks that don't work consistently faced with bytes vs. unicode. It's a real mess. WEB-SIG are bashing out proposals for a WSGI revision; hopefully it can move forward soon...
1
0
0
Is there any framework like RoR on Python 3000?
5
python,ruby-on-rails,frameworks,python-3.x
0
2009-10-02T15:01:00.000
One of the feature I like in RoR is the db management, it can hide all the sql statement, also, it is very easy to change different db in RoR, is there any similar framework in Python 3000?
1
0
0
0
false
1,510,218
0
614
3
0
0
1,510,084
Python 3 is not ready for practical use, because there is not yet enough libraries that have been updated to support Python 3. So the answer is: No. But there are LOADS of them on Python 2. Tens, at least. Django, Turbogears, BFG and of course the old man of the game: Zope. To tell which is best for you, you need to ex...
1
0
0
Is there any framework like RoR on Python 3000?
5
python,ruby-on-rails,frameworks,python-3.x
0
2009-10-02T15:01:00.000
One of the feature I like in RoR is the db management, it can hide all the sql statement, also, it is very easy to change different db in RoR, is there any similar framework in Python 3000?
1
2
0.07983
0
false
1,512,245
0
614
3
0
0
1,510,084
I believe CherryPy is on the verge of being released for Python 3.X.
1
0
0
Is there any framework like RoR on Python 3000?
5
python,ruby-on-rails,frameworks,python-3.x
0
2009-10-02T15:01:00.000
I want 3 columns to have 9 different values, like a list in Python. Is it possible? If not in SQLite, then on another database engine?
12
12
1
0
false
1,517,795
0
25,012
1
0
0
1,517,771
Generally, you do this by stringifying the list (with repr()), and then saving the string. On reading the string from the database, use eval() to re-create the list. Be careful, though that you are certain no user-generated data can get into the column, or the eval() is a security risk.
1
0
0
Is it possible to save a list of values into a SQLite column?
3
python,sqlite
0
2009-10-05T00:26:00.000
Hi I want some help in building a Phone book application on python and put it on google app engine. I am running a huge db of 2 million user lists and their contacts in phonebook. I want to upload all that data from my servers directly onto the google servers and then use a UI to retrieve the phone book contacts of eac...
0
0
0
0
false
1,519,020
1
420
1
0
0
1,518,725
I think you're going to need to be more specific as to what problem you're having. As far as bulk loading goes, there's lots of bulkloader documentation around; or are you asking about model design? If so, we need to know more about how you plan to search for users. Do you need partial string matches? Sorting? Fuzzy ma...
1
0
0
Need help in designing a phone book application on python running on google app engine
2
python,google-app-engine,bulk-load
0
2009-10-05T07:50:00.000
I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi. History: PHP + MySQL years ago PHP + Python 2.x + MySQL recently and current Python + PostgreSQL working on it We use a great library for communicating betwe...
2
1
0.066568
0
false
1,622,505
1
2,259
3
1
0
1,523,706
I can only answer question one: I started using it for some small webstuff but now moved on to rework larger apps with it. Why Werkzeug? The modular concept is really helpful. You can hook in modules as you like, make stuff easily context aware and you get good request file handling for free which is able to cope with ...
1
0
0
Werkzeug in General, and in Python 3.1
3
python,python-3.x,werkzeug
0
2009-10-06T05:13:00.000
I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi. History: PHP + MySQL years ago PHP + Python 2.x + MySQL recently and current Python + PostgreSQL working on it We use a great library for communicating betwe...
2
1
0.066568
0
false
1,523,934
1
2,259
3
1
0
1,523,706
I haven't used Werkzeug, so I can only answer question 2: No, Werkzeug does not work on Python 3. In fact, very little works on Python 3 as of today. Porting is not difficult, but you can't port until all your third-party libraries have been ported, so progress is slow. One big stopper has been setuptools, which is a v...
1
0
0
Werkzeug in General, and in Python 3.1
3
python,python-3.x,werkzeug
0
2009-10-06T05:13:00.000
I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi. History: PHP + MySQL years ago PHP + Python 2.x + MySQL recently and current Python + PostgreSQL working on it We use a great library for communicating betwe...
2
3
0.197375
0
false
1,525,943
1
2,259
3
1
0
1,523,706
mod_wsgi for Python 3.x is also not ready. There is no satisfactory definition of WSGI for Python 3.x yet; the WEB-SIG are still bashing out the issues. mod_wsgi targets a guess at what might be in it, but there are very likely to be changes to both the spec and to standard libraries. Any web application you write toda...
1
0
0
Werkzeug in General, and in Python 3.1
3
python,python-3.x,werkzeug
0
2009-10-06T05:13:00.000
I have a web service with Django Framework. My friend's project is a WIN32 program and also a MS-sql server. The Win32 program currently has a login system that talks to a MS-sql for authentication. However, we would like to INTEGRATE this login system as one. Please answer the 2 things: I want scrap the MS-SQL to use...
1
0
0
0
false
1,529,146
1
203
1
0
0
1,529,128
If the only thing the WIN32 app uses the MS-SQL Server for is Authentication/Authorization then you could write a new Authentication/Authorization provider that uses a set of Web Services (that you would have to create) that expose the Django provider.
1
0
0
Can a WIN32 program authenticate into Django authentication system, using MYSQL?
2
python,windows,django,authentication,frameworks
0
2009-10-07T01:59:00.000
I have a web service with Django Framework. My friend's project is a WIN32 program and also a MS-sql server. The Win32 program currently has a login system that talks to a MS-sql for authentication. However, we would like to INTEGRATE this login system as one. Please answer the 2 things: I want scrap the MS-SQL to use...
0
1
1.2
0
true
1,581,622
1
103
1
0
0
1,533,259
The Win32 client can act like a web client to pass the user's credentials to the server. You will want to store the session cookie you get once you are authenticated and use that cookie in all following requests
1
0
0
Can a WIN32 program authenticate into Django authentication system, using MYSQL?
1
python,mysql,windows,django
0
2009-10-07T02:00:00.000
I'm coding a small piece of server software for the personal use of several users. Not hundreds, not thousands, but perhaps 3-10 at a time. Since it's a threaded server, SQLite doesn't work. It complains about threads like this: ProgrammingError: SQLite objects created in a thread can only be used in that same thread....
3
1
0.033321
0
false
10,863,434
0
3,552
3
0
0
1,547,365
pymongo works with Python 3 now.
1
0
0
A database for python 3?
6
python,database,python-3.x
0
2009-10-10T08:09:00.000
I'm coding a small piece of server software for the personal use of several users. Not hundreds, not thousands, but perhaps 3-10 at a time. Since it's a threaded server, SQLite doesn't work. It complains about threads like this: ProgrammingError: SQLite objects created in a thread can only be used in that same thread....
3
0
0
0
false
1,547,384
0
3,552
3
0
0
1,547,365
You could create a new sqlite object in each thread, each using the same database file. For such a small number of users you might not come across the problems with concurrency, unless they are all writing to it very heavily.
1
0
0
A database for python 3?
6
python,database,python-3.x
0
2009-10-10T08:09:00.000
I'm coding a small piece of server software for the personal use of several users. Not hundreds, not thousands, but perhaps 3-10 at a time. Since it's a threaded server, SQLite doesn't work. It complains about threads like this: ProgrammingError: SQLite objects created in a thread can only be used in that same thread....
3
0
0
0
false
1,550,870
0
3,552
3
0
0
1,547,365
Surely a pragmatic option is to just use one SQLite connection per thread.
1
0
0
A database for python 3?
6
python,database,python-3.x
0
2009-10-10T08:09:00.000
I am doing some pylons work in a virtual python enviorment, I want to use MySQL with SQLalchemy but I can't install the MySQLdb module on my virtual enviorment, I can't use easyinstall because I am using a version that was compiled for python 2.6 in a .exe format, I tried running the install from inside the virtual en...
0
0
1.2
0
true
1,563,869
0
442
1
0
0
1,557,972
Ok Got it all figured out, After I installed the module on my normal python 2.6 install I went into my Python26 folder and low and behold I happened to find a file called MySQL-python-wininst which happened to be a list of all of the installed module files. Basicly it was two folders called MySQLdb and another called M...
1
0
1
Install custom modules in a python virtual enviroment
1
python,mysql,pylons,module,virtualenv
0
2009-10-13T02:43:00.000