<s> from django . db import models <EOL> from django . core . urlresolvers import reverse <EOL> from countries . models import Country <EOL> class InternationalOrganization ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> name = models . CharField ( max_length = <NUM_LIT> ) <EOL> description = models . TextField ( ) <EOL> lat = models . DecimalField ( blank = True , null = True , decimal_places = <NUM_LIT:10> , <EOL> max_digits = <NUM_LIT> ) <EOL> lng = models . DecimalField ( blank = True , null = True , decimal_places = <NUM_LIT:10> , <EOL> max_digits = <NUM_LIT> ) <EOL> members = models . ManyToManyField ( Country , related_name = "<STR_LIT>" ) <EOL> def __unicode__ ( self ) : <EOL> return self . name <EOL> def _get_location ( self ) : <EOL> if not self . lng and self . lat : <EOL> return ( ) <EOL> return self . lng , self . lat <EOL> def _set_location ( self , lng , lat ) : <EOL> if not lng or not lat : <EOL> raise AttributeError ( "<STR_LIT>" ) <EOL> self . lng , self . lat = lng , lat <EOL> location = property ( _get_location , _set_location ) <EOL> def get_absolute_url ( self ) : <EOL> return reverse ( "<STR_LIT>" , kwargs = { "<STR_LIT>" : self . pk } ) </s>
