def drk_default_shelter():
 s3 = current.response.s3
 shelter_id = s3.drk_default_shelter
 if (not shelter_id):
  default_site = current.deployment_settings.get_org_default_site()
  if default_site:
   stable = current.s3db.cr_shelter
   query = (stable.site_id == default_site)
   shelter = current.db(query).select(stable.id, limitby=(0, 1)).first()
   if shelter:
    shelter_id = shelter.id
  s3.drk_default_shelter = shelter_id
 return shelter_id

def drk_default_shelter ( ) : s3 = current . response . s3 shelter_id = s3 . drk_default_shelter if ( not shelter_id ) : default_site = current . deployment_settings . get_org_default_site ( ) if default_site : stable = current . s3db . cr_shelter query = ( stable . site_id == default_site ) shelter = current . db ( query ) . select ( stable . id , limitby = ( 0 , 1 ) ) . first ( ) if shelter : shelter_id = shelter . id s3 . drk_default_shelter = shelter_id return shelter_id
lazy getter for the default shelter_id .