mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 09:43:03 +00:00
started working on pkgedit for comments
This commit is contained in:
parent
aae43d9ad6
commit
e3587ddf94
8 changed files with 148 additions and 28 deletions
|
@ -187,9 +187,11 @@ CREATE TABLE PackageComments (
|
|||
UsersID INTEGER UNSIGNED NOT NULL,
|
||||
Comments TEXT NOT NULl DEFAULT '',
|
||||
CommentTS BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
DelUsersID INTEGER UNSIGNED NOT NULL DEFAULT 0,
|
||||
INDEX (UsersID),
|
||||
INDEX (PackageID),
|
||||
FOREIGN KEY (UsersID) REFERENCES Users(ID) ON DELETE CASCADE,
|
||||
FOREIGN KEY (DelUsersID) REFERENCES Users(ID) ON DELETE CASCADE,
|
||||
FOREIGN KEY (PackageID) REFERENCES Packages(ID) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
|
|
Binary file not shown.
|
@ -267,9 +267,9 @@ for p in seen_pkgs.keys():
|
|||
#
|
||||
num_comments = random.randrange(PKG_CMNTS[0], PKG_CMNTS[1])
|
||||
for i in range(0, num_comments):
|
||||
fortune = esc(commands.getoutput(FORTUNE_CMD).replace("'","").replace("\n"," "))
|
||||
fortune = esc(commands.getoutput(FORTUNE_CMD).replace("'",""))
|
||||
now = NOW + random.randrange(400, 86400*3)
|
||||
s = "INSERT INTO PackageComments (PackageID, UsersID, Comments, CommentTS) VALUES (%d, %d, '%s', %d);\n" % (seen_pkgs[p], uuid, fortune, now)
|
||||
s = "INSERT INTO PackageComments (PackageID, UsersID, Comments, CommentTS) VALUES (%d, %d, '%s', %d);\n" % (seen_pkgs[p], genUID(), fortune, now)
|
||||
out.write(s)
|
||||
|
||||
if location_id == 1: # Unsupported - just a PKGBUILD and maybe other stuff
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue