|
1 | 1 | from tasks.statistics.module import UpdatePage, ArticleTables, index |
2 | 2 |
|
3 | 3 | # Set the parameters for the update |
4 | | -query = """select page.page_title as ll_page_title,pagelinks.pl_title as ll_page_to_title,pagelinks.pl_namespace as ll_pl_namespace |
5 | | -from page |
6 | | - inner join pagelinks |
7 | | - on pagelinks.pl_from = page.page_id |
8 | | -where pagelinks.pl_from_namespace = 0 |
9 | | - and (pagelinks.pl_namespace = 2 or pagelinks.pl_namespace = 3) |
10 | | - and page.page_namespace = 0 |
11 | | - and page.page_is_redirect = 0 |
12 | | - and page.page_id not in (select templatelinks.tl_from from templatelinks |
13 | | - join linktarget on linktarget.lt_id = templatelinks.tl_target_id |
14 | | - where linktarget.lt_title in (select pl_title from pagelinks where pl_from = 9043549) and templatelinks.tl_from_namespace = 0 ) |
15 | | - and page.page_title not in (select pl_title from pagelinks where pl_from = 9043549);""" |
| 4 | +query = """SELECT page.page_title AS ll_page_title, |
| 5 | + linktarget.lt_title AS ll_page_to_title, |
| 6 | + linktarget.lt_namespace AS ll_pl_namespace |
| 7 | +FROM page |
| 8 | +INNER JOIN pagelinks ON pagelinks.pl_from = page.page_id |
| 9 | +inner join linktarget ON lt_id = pl_target_id |
| 10 | +WHERE pagelinks.pl_from_namespace = 0 |
| 11 | + AND (linktarget.lt_namespace = 2 |
| 12 | + OR linktarget.lt_namespace = 3) |
| 13 | + AND page.page_namespace = 0 |
| 14 | + AND page.page_is_redirect = 0 |
| 15 | + AND page.page_id not in |
| 16 | + (SELECT templatelinks.tl_from |
| 17 | + FROM templatelinks |
| 18 | + JOIN linktarget ON linktarget.lt_id = templatelinks.tl_target_id |
| 19 | + WHERE linktarget.lt_title in |
| 20 | + (SELECT lt_title |
| 21 | + FROM pagelinks |
| 22 | + inner join linktarget ON lt_id = pl_target_id |
| 23 | + WHERE pl_from = 9043549) |
| 24 | + AND templatelinks.tl_from_namespace = 0 ) |
| 25 | + AND page.page_title not in |
| 26 | + (SELECT lt_title |
| 27 | + FROM pagelinks |
| 28 | + inner join linktarget ON lt_id = pl_target_id |
| 29 | + WHERE pl_from = 9043549 |
| 30 | + );""" |
16 | 31 | file_path = 'stub/articles_in_which_there_is_a_link_to_user_pages.txt' |
17 | 32 | page_name = "ويكيبيديا:تقارير قاعدة البيانات/مقالات يوجد فيها وصلة إلى صفحات المستخدمين" |
18 | 33 |
|
|
0 commit comments