Форум сайта python.su
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.mainMenu = gtk.MenuBar()
menuItem1 = gtk.MenuItem("_File")
menuItem2 = gtk.MenuItem("_Edit")
self.VBox1 = gtk.VBox(False, 0)
self.window.set_default_size(800,600)
self.window.add(self.VBox1)
self.VBox1.pack_start(self.mainMenu, False, False, 0)
list = [menuItem1, menuItem2]
for i in list:
self.mainMenu.append(menuItem1)
self.VBox1.show()
self.mainMenu.show()
menuItem1.show()
menuItem2.show()
self.window.show()
class myBar (gtk.MenuBar):
def __init__(self):
gtk.MenuBar.__init__(self)
canvas.translate()
# views.py
from ninjapaginator.util import NinjaPaginator
from annoying.decorators import render_to
from blog.models import Post
@render_to('blog_posts.html')
@NinjaPaginator(style='digg', per_page=15)
def list_posts(request):
posts = Post.objects.all()
return {'object_list': posts}
{% for post in object_list %}
{{ post.title }}
{% endfor %}
<p>
{% include "paginator.html" %}
</p>
# that's it, your page now have "digg.com" style paginator.
.__init__(*args, **kwargs)
__init__() got an unexpected keyword argument 'f'
Request Method: POST
Request URL: http://127.0.0.1:8000/accounts/register/
Exception Type: TypeError
Exception Value:
__init__() got an unexpected keyword argument 'f'
clock = EggClockFace()
clock.connect("expose_event", clock.expose)
clock.connect("button_press_event", clock.button_press)
clock.connect("button_release_event", clock.button_release)
clock.connect("time_changed", time_changed_cb)
clock.connect("motion_notify_event", clock.motion_notify)
clock.set_size_request (100, 100)
clock.show ()
main.wTree.get_widget ("table2").attach (clock, 11, 12, 1, 4)
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib import admin
from django.forms.models import modelformset_factory
#Clients
class Client(models.Model):
fname = models.CharField(max_length=255,verbose_name=u'\u0418\u043c\u044f')
lname = models.CharField(max_length=255,verbose_name=u'\u0424\u0430\u043c\u0438\u043b\u0438\u044f')
sname = models.CharField(max_length=255,verbose_name=u'\u041e\u0442\u0447\u0435\u0441\u0442\u0432\u043e')
email = models.EmailField(max_length=100,verbose_name=u'E-Mail')
phone = models.CharField(max_length=100,verbose_name=u'\u0422\u0435\u043b\u0435\u0444\u043e\u043d')
born = models.DateField()
STATUS_CHOICES = (
('0', u'\u041d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d'),
('1', u'\u041d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439'),
('2', u'\u0410\u043a\u0442\u0438\u0432\u043d\u044b\u0439'),
('3', u'\u0414\u043e\u043b\u0436\u043d\u0438\u043a'),
('4', u'\u0421\u043e\u0442\u043e\u043d\u0430!'),
)
status = models.CharField(max_length=2, choices=STATUS_CHOICES,verbose_name=u'')
reg_date = models.DateField(auto_now_add=True,verbose_name=u'\u0414\u0430\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438')
def __unicode__(self):
mstr = self.fname + " " + self.lname + " " + self.sname
return mstr
class Comments(models.Model):
id_user = models.ForeignKey(Client)
subject = models.CharField(max_length=100,verbose_name=u'\u0422\u0435\u043c\u0430')
comment = models.TextField(max_length=500,verbose_name=u'\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435')
post_date = models.TimeField(auto_now_add=True,verbose_name=u'\u0414\u0430\u0442\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f')
class CommentsInline(admin.TabularInline):
model = Comments
extra = 1
#template = "admin/comment_list.html"
class clietnAdmin(admin.ModelAdmin):
#date_hierarchy = 'fname'
list_display = ['__unicode__','status']
fieldsets = [
(u'\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435', {'fields': ['fname','lname','sname','born']}),
(u'\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b', {'fields': ['phone','email','status']}),
]
inlines = [CommentsInline]
admin.site.register(Client,clietnAdmin)
def index(req):
req.content_type = 'text/html'
main = """<form method="POST">
<input type="text" name="test">
<input type="submit">"""
return main
from PyQt4 import QtWebKit, QtCore, QtGui, QtNetwork
import sys
class Webber(QtGui.QMainWindow):
def __init__(self):
##
self.view = QtWebKit.QWebView()
self.view.setGeometry(100, 200, 800, 500)
self.view.load(QtCore.QUrl('http://www.google.com.ua/'))
self.view.show()
app = QtGui.QApplication(sys.argv)
main = Webber()
sys.exit(app.exec_())