我正在开发一个应用程序,现在我正在与一个我创建的名为import pygame
pygame.init()
screenwidth = 500
screenheight = 500
win = pygame.display.set_mode((screenwidth, screenheight))
pygame.display.set_caption('First Game')
bkg = pygame.image.load('2.jpg')
char1 = pygame.image.load('guy.png')
char1 = pygame.transform.scale(char1, (100, 100))
walkLeft = pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png'), pygame.image.load('R5.png'), pygame.image.load('R6.png'), pygame.image.load('R7.png'),
pygame.image.load('R8.png'), pygame.image.load('R9.png'), pygame.image.load('R10.png'), pygame.image.load('R11.png'), pygame.image.load('R12.png')
walkRight = pygame.image.load('L1.png'), pygame.image.load('L2.png'), pygame.image.load('L3.png'), pygame.image.load('L4.png'), pygame.image.load('L5.png'), pygame.image.load('L6.png'), pygame.image.load('L7.png'),
pygame.image.load('L8.png'), pygame.image.load('L9.png'), pygame.image.load('L10.png'), pygame.image.load('L11.png'), pygame.image.load('L12.png')
GameO = pygame.image.load('GO.jpg')
clock = pygame.time.Clock()
class player(object):
def __init__(self, x ,y, width, height):
self.x = x
self.y = y
self.width = width
self.height = height
self.GameOver = False
self.vel = 5
self.walkCount = 0
self.left = False
self.right = False
def draw(self, win):
if self.walkCount + 1 >= 36:
self.walkCount = 0
if self.left:
win.blit(walkLeft,[self.walkCount // 3], (self.x, self.y))
self.walkCount += 1
elif self.right:
win.blit(walkRight,[self.walkCount // 3], (self.x, self.y))
self.walkCount += 1
else:
win.blit(char1, (self.x, self.y))
def redrawgamewindow():
win.blit(bkg, (0, 0))
man.draw(win)
pygame.display.update()
man = player(250, 400, 100, 100)
run = True
while run:
#Setting fps
clock.tick(36)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
run = False
#Getting keys pressed
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT] and man.x > man.vel:
man.x -= man.vel
man.left = True
man.right = False
elif keys[pygame.K_RIGHT] and man.x < 500 - man.vel - man.width:
man.x += man.vel
man.left = False
man.right = True
else:
man.left = False
man.right = False
man.walkCount = 0
redrawgamewindow()
的特定管理员组打交道。
在我的django管理员中,我拥有将群组的权限设置为post admin
我希望为Can Change Post, Can Delete post, Can View Post
组用户提供更好的访问权限,使其能够执行此操作。不仅在管理页面中。我希望他们能够转到我的post admin
并能够编辑/删除任何用户的帖子。
因此,基本上,我需要能够将访问权限授予最初创建帖子的DeleteView, UpdateView
和我的user
组。
任何技巧/建议如何将其合并?