Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import feedparser
  2. from etf.models.issue import Issue
  3. from etf import consts
  4.  
  5. def check_for_rnp(inn: str):
  6. url = "http://zakupki.gov.ru/epz/dishonestsupplier/extendedsearch/rss?searchString=&morphology=on&openMode=USE_DEFAULT_PARAMS&pageNumber=1&sortDirection=false&recordsPerPage=_10&fz94=on&fz223=on&f=on&u=on&customerINN=%s&kpp=&supplierCountryList=1268&regions=&cities=&city=&street=&authorizedOrganizationIds=&inclusionDateFrom=&inclusionDateTo=&sortBy=UPDATE_DATE" % inn
  7. data = feedparser.parse(url)
  8. assert data.get('status') == 200
  9. if len(data['entries']):
  10. print('Да')
  11. else:
  12. print('Нет')
  13.  
  14. all_sb_issues = Issue.objects.filter(status_rejection_reason=consts.ISSUE_STATUS_CANCELLED_UNDERWRIER_REJECTION)
  15. for i in all_sb_issues:
  16. rnp = check_for_rnp(i.issuer_inn)
  17. print(i.id, ' - ', i.issuer_inn, ' - ', rnp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement