Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
SiteRelated, ManyToMany instead of ForeignKey
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Josh Cartmell  
View profile  
 More options Aug 8 2012, 7:58 pm
From: Josh Cartmell <joshcar...@gmail.com>
Date: Wed, 8 Aug 2012 16:58:01 -0700 (PDT)
Local: Wed, Aug 8 2012 7:58 pm
Subject: SiteRelated, ManyToMany instead of ForeignKey
I have a client who may be wanting me to modify Mezzanine's site
handling to allow content to be associated with multiple sites, rather
than just a single one.  This has been discussed before and a number
of problems and things that would need to be considered further were
brought up.  The discussion is here:
groups.google.com/group/mezzanine-users/browse_thread/thread/
e173dee4c683e05c/

notably:
- What happens when a child page gets assigned to a second site that
doesn't have the parent?
- How can the page's _order field (for ordering) be used which it's
relative to the other pages on that branch? We'd need to break
ordering out
into its own table that stored page IDs, site IDs and _order values -
not
sure if it's the right approach or not, but either way it's a big step
from
how it is now.

I am wondering if there is any interest in this in this idea in the
wider Mezzanine community.  I was also wondering if anyone had any
comments on any further considerations that would need to go into
this?  I would ideally want to make this in such a way that it could
be pushed back into Mezzanine core.

Alternatively, would it be feasible to provide an additional Mezzanine
sites mixin that would allow certain content types to use a ManyToMany
and others (pages) to use a ForeignKey, since most content types
wouldn't have to worry about order or parents the same way pages do
since they don't have a hierarchy.

The client would also like the ability to manage permissions for admin
users that would restrict which sites they could access.  Is there any
interest in or thoughts about that idea?

Regards,
Josh


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen McDonald  
View profile  
 More options Aug 9 2012, 5:14 pm
From: Stephen McDonald <st...@jupo.org>
Date: Fri, 10 Aug 2012 07:14:06 +1000
Local: Thurs, Aug 9 2012 5:14 pm
Subject: Re: [mezzanine-users] SiteRelated, ManyToMany instead of ForeignKey

Firstly, everything you've described is a welcome change. I think it
represents the next level of multi-tenancy in Mezzanine, and ultimately
we'd end up with sites as a manytomany field *everywhere*. However I think
it'll require some significant changes.

On Thu, Aug 9, 2012 at 9:58 AM, Josh Cartmell <joshcar...@gmail.com> wrote:
> I have a client who may be wanting me to modify Mezzanine's site
> handling to allow content to be associated with multiple sites, rather
> than just a single one.  This has been discussed before and a number
> of problems and things that would need to be considered further were
> brought up.  The discussion is here:
> groups.google.com/group/mezzanine-users/browse_thread/thread/
> e173dee4c683e05c/

> notably:
> - What happens when a child page gets assigned to a second site that
> doesn't have the parent?

Please tear this idea apart as I'm sure it has flaws. I think what we'd
need to do here is somehow filter the sites that can be chosen from based
on the parents. Eg: with sites A, B and C: page called "primary" gets added
to sites A and B. When adding a child page to "primary", only A and B would
be available as related sites to add to.

> - How can the page's _order field (for ordering) be used which it's
> relative to the other pages on that branch? We'd need to break
> ordering out
> into its own table that stored page IDs, site IDs and _order values -
> not
> sure if it's the right approach or not, but either way it's a big step
> from
> how it is now.

Yes that's a big step and the correct one. Ordering would need to be
implemented in a separate site-specific table which would contain a site
ID, page ID, and order value.

> I am wondering if there is any interest in this in this idea in the
> wider Mezzanine community.  I was also wondering if anyone had any
> comments on any further considerations that would need to go into
> this?  I would ideally want to make this in such a way that it could
> be pushed back into Mezzanine core.

> Alternatively, would it be feasible to provide an additional Mezzanine
> sites mixin that would allow certain content types to use a ManyToMany
> and others (pages) to use a ForeignKey, since most content types
> wouldn't have to worry about order or parents the same way pages do
> since they don't have a hierarchy.

I think for consistency's sake in the database and models it should be one
or the other. If we want things to only be related to one site, we can have
a way of not having the sites field editable via the admin, and a single
site can be implicitly assigned based on the current site. Again please
tear this apart if you can see flaws.

> The client would also like the ability to manage permissions for admin
> users that would restrict which sites they could access.  Is there any
> interest in or thoughts about that idea?

I think this a wider feature that applies to more than just sites, that is,
object level permissions. I think if we solve that problem at a wider
level, the solution for sites would become clear.

> Regards,
> Josh

--
Stephen McDonald
http://jupo.org

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josh Cartmell  
View profile  
 More options Aug 9 2012, 9:36 pm
From: Josh Cartmell <joshcar...@gmail.com>
Date: Thu, 9 Aug 2012 18:36:05 -0700
Local: Thurs, Aug 9 2012 9:36 pm
Subject: Re: [mezzanine-users] SiteRelated, ManyToMany instead of ForeignKey

Thanks for the feedback Steve, I definitely think it will be a big
undertaking.  I'm glad that there is interest in the idea here, I will try
to keep the list updated with any progress I make.  It will probably be
awhile still before I start in on it but I wanted to start the juices
flowing.

I agree that children should only be able to be added to sites that their
parents belong too.  If you remove a site from a page I envision an
intermediary page after saving that would inform you if children pages will
be removed from sites at all (similar to how when you delete an object
there is a page which tells you which related objects will be deleted).

The table structure you suggested for ordering sounds good to me.

I'll keep thinking about how permissions would fit into this.

If anyone else has suggestions or comments I would be very open to them.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »