<s> from feincms . module . page . models import Page <EOL> from facebook . modules . profile . application . utils import get_app_dict <EOL> def get_application_from_request ( request ) : <EOL> try : <EOL> page = Page . objects . for_request ( request , best_match = True ) <EOL> return getattr ( page , '<STR_LIT>' , None ) <EOL> except Page . DoesNotExist : <EOL> return None <EOL> def get_page_from_request ( request ) : <EOL> try : <EOL> page = Page . objects . for_request ( request , best_match = True ) <EOL> return getattr ( page , '<STR_LIT>' , None ) <EOL> except Page . DoesNotExist : <EOL> return None <EOL> def get_tab_url_from_request ( request ) : <EOL> try : <EOL> page = Page . objects . for_request ( request , best_match = True ) <EOL> except Page . DoesNotExist : <EOL> return None <EOL> fb_app = get_app_dict ( getattr ( page , '<STR_LIT>' , None ) ) <EOL> fb_page = getattr ( page , '<STR_LIT>' , None ) <EOL> if fb_page and fb_app : <EOL> if '<STR_LIT:?>' in fb_page . facebook_link : <EOL> separator = '<STR_LIT:&>' <EOL> else : <EOL> separator = '<STR_LIT:?>' <EOL> return u'<STR_LIT>' % ( fb_page . facebook_link , separator , fb_app [ '<STR_LIT>' ] ) <EOL> else : <EOL> return None </s>
