Форум сайта python.su
brush.function=gtk.gdk.COPY
python: ../../src/xcb_lock.c:77: _XGetXCBBuffer: Assertion `((int) ((xcb_req) - (dpy->request)) >= 0)' failed.не спасает даже try
import MySQLdb
db = MySQLdb.connect("ffff")
db.cursor() # курсора уже не будет в выпадающем списк, будет тока список методов начинающихся с __ и заканчивающихся тоже __
#но если допустим делаю вот так
db = MySQLdb.connection("ffff")
db.cursor() #то все выпадает, т.е. после набора db. у меня получается список функций где в том числе есть cursor()
IP = '127.0.0.1'
PORT = 8000
SITE = 'http://%s:%s' % (IP, PORT)
class TwillMock(object):
def setup(self):
'''
- setup twill virtual web server
'''
from django.core.servers.basehttp import AdminMediaHandler
from django.core.handlers.wsgi import WSGIHandler
from wsgi_intercept import add_wsgi_intercept
app = AdminMediaHandler(WSGIHandler())
add_wsgi_intercept(IP, PORT, lambda: app)
class NotATestTwillRegistration(TwillMock):
def test_login_success(self, username='test', password='test'):
go(SITE + '/accounts/login/')
code(200)
formvalue(1, 'username', username)
formvalue(1, 'password', password)
submit()
url(SITE + '/accounts/profile/')
code(200)
def test_incorrect_password(self):
go(SITE + '/accounts/login/')
code(200)
formvalue(1, 'username', 'test')
formvalue(1, 'password', 'OMG! I have forgotten it!')
submit()
url(SITE + '/accounts/login/')
find('<ul class="errorlist">')
code(200)
import xmpp
jidd = """
myacount@jabber.ru
myacount
"""
jidd = xmpp.protocol.JID(jidd)
client = xmpp.Client(jidd.getDomain, debug = [])
connected = client.connect(server = ('jabber.ru', 5223))
client.auth( jidd.getNode , 'password', 'myaccount')
client.sendInitPresence()
$(document).ready(function(){
$("#id_name").autocomplete("{{ current_site }}{% url reference_name %}", {mustMatch: false});
def reference_street(request):
word = request.GET.get('q', u'---')
try:
streets = ReferenceStreet.objects.filter(street__startswith=word)
except:
streets = u'None'
return HttpResponse(streets)
Django version 1.1 pre-alpha SVN-9832, using settings 'notary.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[16/Feb/2009 15:09:30] "GET /bookreference/street/?q=w&limit=150×tamp=1234789769304 HTTP/1.1" 200 38
[16/Feb/2009 15:12:19] "GET /bookreference/street/?q=%D0%B7&limit=150×tamp=1234789939903 HTTP/1.1" 200 0
def index(self):
countries = si.meta.Session.query(si.Countries).first()
c.a_countries = FieldSet(countries, data=request.params)
if c.a_countries.validate():
c.a_countries.sync()
si.meta.Session.commit()
c.a_countries.configure(options=[c.a_countries.name.label(_(u'Наименование')).required(),
c.a_countries.code.label(_(u'Код')).required(),
c.a_countries.archive.label(_(u'Архив')),],
exclude = [c.a_countries.createdt],
readonly=False)
return render('/admin/layouts/geography.mako')
class Photo(models.Model):
description = models.CharField(max_length=100, blank=True)
photo = models.ImageField(upload_to='/home/r/project/django/mysite/' )
class PhotoForm(forms.ModelForm):
class Meta:
model = Photo