Tagged Questions
0
votes
0answers
25 views
MySQL query cause error: ProgrammingError: Wrong number of arguments during string formatting
wquery = """UPDATE `cin`.`flags` SET `flag`='%s', `update_time`='%d' WHERE `name`='%s' AND `lockid`='%s'"""
cursor.execute(wquery, (pic_bin, update_time, cname, lockid,))
cnx.commit()
...
0
votes
1answer
36 views
Access hashed mysql password from python
This seems somewhat trival but I have spent a bit of time googling with no results. Anyways I am developing a web app and I need to store 'sensitive' data in a mysql database and then access it to ...
0
votes
1answer
24 views
upload web files to mysql in python
I am new to python and looking for a way to execute a "complicated" task.
I need to store small images (less than 1mb each) into the Image column (blob) of my DB. My script currently retrieve URLs ...
0
votes
1answer
17 views
How can I use SQLAlchemy to do “mysql explain”
I have a sql like:
DBSession().query(Model).filter(***)
and I want to explain this sql using SQLAlchemy.
0
votes
1answer
13 views
python mysql type error
In python I am having trouble with the types in the following code:
>>> curRow = 1 ...
1
vote
1answer
17 views
Syntax error (1064) in MySQL statement in Python
I'm trying to insert all of my data to a table I created. This is the relevant part of my code:
rows_inserted = 0
table_name = "mytable"
for row in ordered: # ordered is a list of ...
0
votes
1answer
17 views
mysql python hangup debugging
My program seems to not be terminating... As I am relatively new to python I would suspect I made a common mistake that I do not see yet. Even recently in Java I have resolved simple problems like ...
0
votes
1answer
22 views
MySQLdb / Python / LocalHost - Query runs without error but no result
I'm hoping someone can help me? I'm trying to populate a MySQL database using Python 2.7 and the MySQLdb library. I've written the sample script below but no matter what I try, I can't get it to work.
...
-3
votes
1answer
18 views
php or python program to take urls from desktop html files [closed]
How can we create a program so that is directly takes all the url's along with names present in a folder and store it in phpmyadmin sql
0
votes
1answer
16 views
how to add a instance of a foreign key to an instance of a model that it points to
I have a Django app wherein a user can schedule command line 'Jobs' to run on remote systems. Here's my models.py defining Job and a foreign key relationship
class Job(models.Model):
name = ...
0
votes
1answer
23 views
Issue with transforming data on insert?
So I was wondering if anyone could help me.
I currently have some class
class Sha1(ColumnClause):
pass
@compiles(Sha1)
def compile_sha1(element, compiler, **kw):
return ...
0
votes
2answers
20 views
how to establish in models file that a django model should be defined as NOT NULL?
In my models.py file I would like a way to explicitly state that certain fields in my model should be defined as NOT NULL such that the MySQL code would be
CREATE TABLE Minion_job(MyColumn ...
1
vote
1answer
18 views
foreign keys between databases with peewee
I have two legacy MySQL databases for which I'd like to define an ORM class-model in peewee (python). Specifically, one database holds front-end data, the other back-end data and some information ...
0
votes
1answer
47 views
How can i make the tree like menus from python list
I have the name of files in the list with folders. The list contains 2000 file names like this
Countries/US/newyork/file1.pdf
Countries/Australia/Sydney/file1.pdf
...
0
votes
1answer
17 views
SQLAlchemy DELETE Error caused by having a both lazy-load AND a dynamic version of the same relationship
Here is some example code:
users_groups = Table('users_groups', Model.metadata,
Column('user_id', Integer, ForeignKey('users.id')),
Column('group_id', Integer, ForeignKey('groups.id'))
)
...