Difference between revisions of "Python MySQL API"
Jump to navigation
Jump to search
(→Common: update) |
(→Common: cleanup) |
||
| Line 1: | Line 1: | ||
==Common== | ==Common== | ||
| − | * ''' | + | |
| − | + | * '''SQLgetDatabaseStatus'''() - This function can be called to obtain the current status of the database. 0=offline, 1=online. The value is changed through the moderator cpanel. | |
| − | * '''SQLgetEditingStatus | + | * '''SQLgetEditingStatus'''() - This function can be called to obtain the current editing status. 0=offline, 1=public editing, 2=moderator-only editing. The value is changed through the moderator cpanel. |
| − | * ''' | + | * '''SQLgetNotes'''(note_id) - This function returns text from the notes table. |
| + | ** '''note_id''' - the record number of the note. | ||
| + | * '''SQLgetSchemaVersion'''() - Returns the current schema version. There is no standard for defining schema versions as yet, so this may be deprecated in the future. | ||
| + | * '''SQLgetSubmitterID'''(submitter) - Converts a user name to a user_id. | ||
| + | ** '''submitter''' - The user's name. | ||
| + | * '''SQLgetSubmitterName'''(submitter) - This appears to be a variant duplicate of SQLgetUserName(). This needs to be cleaned up. | ||
| + | ** '''submitter''' - the user ID of the user. | ||
| + | * '''SQLgetUserName'''(userId) - This function returns a plain text user name. | ||
| + | ** '''userId''' - the user ID of the user. | ||
| + | * '''SQLisUserModerator'''(userId) - This function returns 1 if the user is a moderator, otherwise it returns 0. | ||
| + | ** '''userId''' - the user ID of the user. | ||
| + | * '''SQLloadXML'''(recno) - This function loads the XML payload associated with a data submission. | ||
| + | ** '''recno''' - record number of the submission. | ||
| + | * '''SQLloadState'''(recno) - This function loads the state of a data submission (N=new, I=integrated, R=rejected). | ||
| + | ** '''recno''' - record number of the submission. | ||
| + | * '''SQLmarkIntegrated'''(db, recno, reviewerid) - This function marks a submission record as approved. This probably doesn't need db as an argument. | ||
| + | ** '''db''' - database handle | ||
| + | ** '''recno''' - the submission number being approved. | ||
| + | ** '''reviewerid''' - the user ID of the approver. | ||
| + | * '''SQLUpdateQueries'''() - This function is executed whenever SQLparsing.py is imported. It's not intended for application use. | ||
| + | * '''SQLwikiLinkExists'''(namespace, title) - Returns 1 if the wiki page exists in the wiki area of the database, otherwise returns 0. | ||
| + | ** '''namespace''' - namespace of the wiki page. Although wiki pages are not required to use a namespace, all pages that the ISFDB might link to do. | ||
| + | ** '''title''' - title of the wiki article. | ||
* '''todaysDate()''' - This should probably be moved elsewhere, as it has nothing to do with the MySQL interface. | * '''todaysDate()''' - This should probably be moved elsewhere, as it has nothing to do with the MySQL interface. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
==Authors== | ==Authors== | ||
Revision as of 06:40, 3 June 2008
Common
- SQLgetDatabaseStatus() - This function can be called to obtain the current status of the database. 0=offline, 1=online. The value is changed through the moderator cpanel.
- SQLgetEditingStatus() - This function can be called to obtain the current editing status. 0=offline, 1=public editing, 2=moderator-only editing. The value is changed through the moderator cpanel.
- SQLgetNotes(note_id) - This function returns text from the notes table.
- note_id - the record number of the note.
- SQLgetSchemaVersion() - Returns the current schema version. There is no standard for defining schema versions as yet, so this may be deprecated in the future.
- SQLgetSubmitterID(submitter) - Converts a user name to a user_id.
- submitter - The user's name.
- SQLgetSubmitterName(submitter) - This appears to be a variant duplicate of SQLgetUserName(). This needs to be cleaned up.
- submitter - the user ID of the user.
- SQLgetUserName(userId) - This function returns a plain text user name.
- userId - the user ID of the user.
- SQLisUserModerator(userId) - This function returns 1 if the user is a moderator, otherwise it returns 0.
- userId - the user ID of the user.
- SQLloadXML(recno) - This function loads the XML payload associated with a data submission.
- recno - record number of the submission.
- SQLloadState(recno) - This function loads the state of a data submission (N=new, I=integrated, R=rejected).
- recno - record number of the submission.
- SQLmarkIntegrated(db, recno, reviewerid) - This function marks a submission record as approved. This probably doesn't need db as an argument.
- db - database handle
- recno - the submission number being approved.
- reviewerid - the user ID of the approver.
- SQLUpdateQueries() - This function is executed whenever SQLparsing.py is imported. It's not intended for application use.
- SQLwikiLinkExists(namespace, title) - Returns 1 if the wiki page exists in the wiki area of the database, otherwise returns 0.
- namespace - namespace of the wiki page. Although wiki pages are not required to use a namespace, all pages that the ISFDB might link to do.
- title - title of the wiki article.
- todaysDate() - This should probably be moved elsewhere, as it has nothing to do with the MySQL interface.
Authors
- SQLgetAuthorData(author):
- SQLloadAuthorData(author_id):
- SQLauthorIsPseudo(au_id):
- SQLauthorHasPseudo(au_id):
- SQLgetActualFromPseudo(au_id):
- SQLgetPseudoFromActual(au_id):
- SQLupdateViews(author_id):
- SQLloadEmails(author_id):
- SQLloadWebpages(author_id):
- SQLbornToday():
- SQLdiedToday():
- SQLgetAuthorVariants(author_id):
- SQLGetInterviews(author_id):
- SQLFindAuthors(target):
Titles
- SQLupdateTitleViews(title_id):
- SQLloadTitlesXBA(aurec, alpha, views, chron):
- SQLserialTitlesXBA(aurec, alpha, views):
- SQLloadLongTitlesXBA(aurec, alpha, views):
- SQLloadAnyTitles(aurec):
- SQLloadShortTitlesXBA(aurec, alpha, views):
- SQLloadTitlesXBT(recno):
- SQLloadIntervieweeXBA(author):
- SQLloadTitle(titlerec):
- SQLFindTitles(target):
- SQLCollaborators(author_id):
- SQLTitleCollaborators(title_id, author_id):
- SQLTitleAuthors(title_id):
- SQLInterviewAuthors(title_id):
- SQLReviewAuthors(title_id):
- SQLFindYear(target):
- SQLgetTitle(titleId):
- SQLgetTitleVariants(title_id):
- SQLgetSerialsByTitle(title):
- SQLFindReviewParent(title, author):
- SQLloadTitleReviews(title_id):
- SQLfindReviewedTitle(review_id):
Series
- SQLgetShortSeriesData(authorec):
- SQLgetEssaySeriesData(authorec):
- SQLget1Series(seriesrec):
- SQLgetNCSeriesData(authorec):
- SQLgetASeriesData(authorec):
- SQLgetESeriesData(authorec):
- SQLgetNFSeriesData(authorec):
- SQLFindSeries(target):
- SQLFindSeriesChildren(id):
- SQLgetSeriesName(id):
- SQLFindSeriesId(target):
- SQLFindSeriesName(target):
- SQLFindSeries2(target):
- SQLloadTitlesXBS(series):
Awards
- SQLloadTitleFromAward(award_id):
- SQLloadAwardsXBA(author):
- SQLloadAwardsXBY(year):
- SQLTitleAwards(title_id):
- SQLloadAwards(award_id):
Publications
- SQLGetForthcoming(month, year, day, all):
- SQLGetTodaysPubs(month, year, day, limit):
- SQLGetPubByTag(tag):
- SQLGetPubById(tag):
- SQLGetPubsByTitle(titlerec):
- SQLGetPubsByPublisherYear(publisher_id, year):
- SQLGetPubsByAuthor(aurec):
- SQLGetPubsByPublisherYear(publisher_id, year):
- SQLGetPubContentByAuthor(aurec):
- SQLFindPubsByIsbn(target):
- SQLPubAuthors(pub_id):
- SQLMarqueAuthors(pub_id):
- SQLgetTitleReferral(pub_id):
- SQLgetPubTitle(pubId):
- SQLGetPubContentList(pub_id):
- SQLRefList():
- SQLVerificationList(pub_id):
Publishers
- SQLGetPublisher(pubrec):
- SQLFindPublisher(target):
- SQLGetPublisherYears(publisher_id):
- SQLgetPublisherName(id):
- SQLloadPublisherWebpages(publisher_id):
User Tags
- SQLgetAuthorTags(author_id):
- SQLgetTitleTags(title_id):
- SQLgetUserTags(title_id, user_id):
- SQLGetTagById(tag_id):
- SQLgetPopularTags():
- SQLsearchTags(tag):