Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8078027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:39:40+00:00 2026-06-05T15:39:40+00:00

import MySQLdb import sys from libdesklets.controls import Control from IDBConnection import IDBConnection class DBConnection(Control,

  • 0
import MySQLdb
import sys

from libdesklets.controls import Control
from IDBConnection import IDBConnection

class DBConnection(Control, IDBConnection):
  host = 'xxxx'
  user = 'xxxx'
  passwd = 'xxxx'
  db = 'xxxx'

def __init__(self):   
  Control.__init__(self)
  pass

def __get_dbconnection(self):
  db = MySQLdb.connect(self.host, self.user, self.passwd, self.db)
  return db

def __insert(self):   
  db = self.__get_dbconnection()
  cursor = db.cursor()
  cursor.execute("INSERT INTO Usernotes (UID, NID, Inhalt) VALUES (3, 1, 'text');")
  cursor.close()
  db.close()

def __select(self):
  db = self.__get_dbconnection()
  cursor = db.cursor()
  cursor.execute("SELECT Inhalt FROM Usernotes WHERE UID = 1 AND NID = 1;")
  cursor.close()
  db.close()

def __update(self):
  db = self.__get_dbconnection()
  cursor = db.cursor()
  cursor.execute("UPDATE Usernotes SET Inhalt = 'inserttest' WHERE UID = 1 AND NID = 2;")
  cursor.close()
  db.close()

insert = property(__insert, doc="insert into database")
select = property(__select, doc="select from database")
update = property(__update, doc="update database")

def get_class(): return DBConnection

The code above is a Control to work with a mysql-Database for Linux gdesklets (thats where import Control and import IDBConnection is coming from). So when we call the properties from another file (dbc.insert() / dbc.select() / dbc.update()) we get the error “‘NoneType’ object is not callable”. If we add return types we get “‘ReturnType’ object is not callable”. The functions are working and the database operations are done but the display-file (where the functions are called) crashes after the exception.

Hopefully someone can help us here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:39:41+00:00Added an answer on June 5, 2026 at 3:39 pm

    Your query returned an empty set, or the value of a column was null.

    Without a specific error, it’s more difficult to say, but I think your select is coming up with an empty set.

    Your insert sets UID = 3 and NID = 1, your update is looking to change where UID = 1 and NID 2, but your select is looking for UID = 1 and NID = 1.

    I’m guessing that’s where it’s bombing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

import MySQLdb x=raw_input('user> ') y=raw_input('passwd> ') db=MySQLdb.Connect(host=localhost, user=%s, passwd=%s % x,y) cursor=db.cursor() cursor.execute('GRANT ALL
import MySQLdb import csv import sys db = MySQLdb.connect(host,username,password,dbname ) c = db.cursor() posfile
from Tkinter import * import MySQLdb def tran() : first= Tk() label1 = Label(first
I can import MySQLdb from the interactive python command line but Zope gives me
import sys sys.path.append('/home/myuser/svn-repos/myproject') from myproject.settings import * But, it says module not found when
import wx class MainFrame(wx.Frame): def __init__(self,parent,title): wx.Frame.__init__(self, parent, title=title, size=(640,480)) self.mainPanel=DoubleBufferTest(self,-1) self.Show(True) class DoubleBufferTest(wx.Panel):
#!/usr/bin/python import MySQLdb import sys import csv csvfile='/home/arun/Documents/smartearn/Linux/SA/xbrlparser/UGT-2012-Concepts.csv' def csvparsing(): spamReader = csv.reader(open(csvfile, 'rb'),
After I installed MySQLdb by sudo apt-get install python-mysqldb I can import and use
import java.lang.Math; public class NewtonIteration { public static void main(String[] args) { System.out.print(rootNofX(2,9)); }
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class DateDemo { public static void main(String[]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.