terranodo / landscapeportal

landscape portal geonode_project
0 stars 1 forks source link

Sites framework #6

Open matthewhanson opened 9 years ago

matthewhanson commented 9 years ago

From simod's initial push:

# We also need the logic to manage the resourcebse per site belonging, like signals?

class SiteResources(models.Model):
    """Relations to link the resources to the sites"""
    site = models.OneToOneField(Site)
    resources = models.ManyToManyField(ResourceBase)

    def __unicode__(self):
        return resource.title

ResourceBase should cover Layers, Maps, Documents. However users and groups will also need to be based per site.

I see the api changes. Is it only the Filter by Site line being changed here or are there other changes?

 resources_for_site = SiteResources().object.get(site__id=get_current_site(request).id).resources.all()
simod commented 9 years ago

I was assuming (from the doc) that users and groups were shared among all sites. Correct it's only a filter by site.