
__authors__ = [
    '"Madhusudan.C.S" <madhusudancs@gmail.com>',
    ]


from soc.modules.gsoc.models.slot_transfer import GSoCSlotTransfer


def getSlotTransferEntityForOrg(org_entity):
  """Returns the slot transfer entity for the organization.

  params:
    org_entity: the Organization for which the slot transfer entity must be
        fetched

  returns:
    The slot transfer entity for the given organization
  """

  q = GSoCSlotTransfer.all().ancestor(org_entity)
  return q.get()


__authors__ = [
    '"Madhusudan.C.S" <madhusudancs@gmail.com>',
    ]


from soc.modules.gsoc.models.slot_transfer import GSoCSlotTransfer


def getSlotTransferEntitiesForOrg(org_entity, limit=1000):
  """Returns the slot transfer entity for the organization.

  params:
    org_entity: the Organization for which the slot transfer entity must be
        fetched

  returns:
    The slot transfer entity for the given organization
  """

  q = GSoCSlotTransfer.all().ancestor(org_entity)
  return q.fetch(limit=limit)

Modify the logic to get slot transfer entities to return all the entities per org.
Modify the logic to get slot transfer entities to return all the entities per org.

The logic is now changed from having only one slot transfer entity per org to multiple
slot transfer entities per org.

--HG--
extra : rebase_source : d5526723d69356f4d076143f4dc537c7eeed74c0

  
  __authors__ = [
      '"Madhusudan.C.S" <madhusudancs@gmail.com>',
      ]
  
  
  from soc.modules.gsoc.models.slot_transfer import GSoCSlotTransfer
  
  
- def getSlotTransferEntityForOrg(org_entity):
+ def getSlotTransferEntitiesForOrg(org_entity, limit=1000):
    """Returns the slot transfer entity for the organization.
  
    params:
      org_entity: the Organization for which the slot transfer entity must be
          fetched
  
    returns:
      The slot transfer entity for the given organization
    """
  
    q = GSoCSlotTransfer.all().ancestor(org_entity)
-   return q.get()
+   return q.fetch(limit=limit)
  
Modify the logic to get slot transfer entities to return all the entities per org.
## Code Before:

__authors__ = [
    '"Madhusudan.C.S" <madhusudancs@gmail.com>',
    ]


from soc.modules.gsoc.models.slot_transfer import GSoCSlotTransfer


def getSlotTransferEntityForOrg(org_entity):
  """Returns the slot transfer entity for the organization.

  params:
    org_entity: the Organization for which the slot transfer entity must be
        fetched

  returns:
    The slot transfer entity for the given organization
  """

  q = GSoCSlotTransfer.all().ancestor(org_entity)
  return q.get()

## Instruction:
Modify the logic to get slot transfer entities to return all the entities per org.
## Code After:

__authors__ = [
    '"Madhusudan.C.S" <madhusudancs@gmail.com>',
    ]


from soc.modules.gsoc.models.slot_transfer import GSoCSlotTransfer


def getSlotTransferEntitiesForOrg(org_entity, limit=1000):
  """Returns the slot transfer entity for the organization.

  params:
    org_entity: the Organization for which the slot transfer entity must be
        fetched

  returns:
    The slot transfer entity for the given organization
  """

  q = GSoCSlotTransfer.all().ancestor(org_entity)
  return q.fetch(limit=limit)
