Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Add signal to support additional foreign keys on Sample #14

Merged
merged 1 commit into from
Aug 25, 2014

Conversation

awenocur
Copy link
Contributor

This allows the delete-sample command to be extended, to support models with foreign keys pointing to Sample.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) when pulling 644b9e0 on awenocur:add-signal into 1f67a2a on cbmi:master.

@@ -0,0 +1,3 @@
from django.dispatch import Signal

pre_delete_sample = Signal(providing_args=["pk_set", "cursor"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change strings to use single quotes to be consistent with the rest of the codebase.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.14%) when pulling 31441ab on awenocur:add-signal into 1f67a2a on cbmi:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.14%) when pulling 31441ab on awenocur:add-signal into 1f67a2a on cbmi:master.

@@ -111,6 +113,9 @@ def handle(self, *args, **options):
''', [project_id])

# Remove samples
pre_delete_sample.send(sender=Project,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is going to use the pre_delete_sample signal then the pk_set argument should be the sample IDs in the project being deleted. If you are going to send the project ID then change this to use a new pre_delete_project signal.

@naegelyd
Copy link
Collaborator

Please squash this into a single commit

@@ -111,6 +113,9 @@ def handle(self, *args, **options):
''', [project_id])

# Remove samples
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reorder these lines:

pre_delete_project.send(
    sender=Project, pk=project_id, cursor=cursor)

# Remove samples
cursor.execute('''
    DELETE FROM sample WHERE project_id = %s
''', [project_id])

@awenocur awenocur force-pushed the add-signal branch 2 times, most recently from 7129ef8 to cabfd72 Compare August 25, 2014 15:30
@coveralls
Copy link

Coverage Status

Coverage increased (+0.16%) when pulling cabfd72 on awenocur:add-signal into 1f67a2a on cbmi:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.16%) when pulling cabfd72 on awenocur:add-signal into 1f67a2a on cbmi:master.

@@ -70,6 +71,8 @@ def handle(self, *args, **options):
'''.format(columns), valid_ids)

# Remove sample
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

Signed-off-by: Adam Wenocur <wenocur@email.chop.edu>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.16%) when pulling 1655d3e on awenocur:add-signal into 1f67a2a on cbmi:master.

naegelyd added a commit that referenced this pull request Aug 25, 2014
Add signal to support additional foreign keys on Sample
@naegelyd naegelyd merged commit 0003962 into chop-dbhi:master Aug 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants