Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/location/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
from ..utils import countries
from ..utils.populations import country_population

class Locations:
def __init__(self,locations: list[Location]):
self.locations = locations

def add_service(self,location):
self.locations.append(location)

def get_location(self):
return locations

# pylint: disable=redefined-builtin,invalid-name
class Location: # pylint: disable=too-many-instance-attributes
Expand Down
10 changes: 10 additions & 0 deletions app/services/location/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
from abc import ABC, abstractmethod


class LocationServices:
def __init__(self,location_services: list[LocationService]):
self.location_services = location_services

def add_service(self,location_service):
self.location_services.append(location_service)

def get_service(self):
return location_services

class LocationService(ABC):
"""
Service for retrieving locations.
Expand Down