Opened 10 years ago
Closed 9 years ago
#1028 closed enhancement (fixed)
Federated models
Reported by: | Jessica Tallon | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | programming | Keywords: | federation, models, pump.io |
Cc: | Elrond | Parent Tickets: |
Description
As we progress with federation new models are required to hold data we didn't need to store before and certain data shouldn't be required anymore. I have come up with example models which I think will work well as well as a generic foreign key implementation.
I've attached the org-mode file for future reference but I've uploaded the exported HTML version to:
Attachments (2)
Change History (6)
by , 10 years ago
Attachment: | new_models.org added |
---|
comment:1 by , 10 years ago
Okay, …
General: I think, the code snippets serve as "Show the idea, from programmer to programmer". So I will not do a code review, but an idea review. If you want a code review, let me know.
Note: All those X = Column(Integer, ForeignKey("core__activity_intermediators.id"))
are another form of a generic foreign key. I don't know yet, what this statement effects. I just wanted to make this clear and obvious. It might mean, that some thing might need to be refactored. At a second look: The new "Activity" uses new-generic-foreign-key. So is this old thing still needed?
"We don't need referential integrity" is a quick thing. I don't want to buy this one so easily and simple. You know, I like referential integrity. Let's assume, you're right -- I really guess, you are. What I would like people to do: If they do not enforce RI, I would like them to add a comment explaining why this is good.
Why those non classy ..._link_table = Table(...
declarations? To be honest, I have a hard time reading them. Is there a reason for this?
I don't see an answer to the special lists yet. But I don't have one myself either.
comment:2 by , 10 years ago
You're right the code is just an example to show the idea, a code review will be needed later once I implement this properly.
The Activity models can now use the new GenericForeignKey
and we can remove the ActivityIntermediatory
model. I've updated the document to reflect that.
The reason we don't need referential integrity in most places is because of the way delete works on most things now. The new models bring a new way of handling deletions which is when a delete occurs we remove the bulk of the data leaving a shell object and other data such as comments remain. This choice has been made because of how the pump.io API currently works and if comments could be valuable in their own right (conclusion: they are).
The non-classy link table definitions should be classes and I've converted those.
by , 10 years ago
Attachment: | new_models_r1.org added |
---|
comment:3 by , 10 years ago
Owner: | set to |
---|---|
Status: | new → in_progress |
This is being worked on, the code is https://notabug.org/Tsyesika/federated-mediagoblin/src/GenericForeignKey
comment:4 by , 9 years ago
Owner: | removed |
---|---|
Resolution: | → fixed |
Status: | in_progress → closed |
Done, there were several commits about a month ago which more or less wrapped this up.
new models org file