Merge lp:~dholbach/harvest/980657 into lp:harvest

Proposed by Daniel Holbach
Status: Merged
Merged at revision: 335
Proposed branch: lp:~dholbach/harvest/980657
Merge into: lp:harvest
Diff against target: 12 lines (+2/-0)
1 file modified
harvest/services/__init__.py (+2/-0)
To merge this branch: bzr merge lp:~dholbach/harvest/980657
Reviewer Review Type Date Requested Status
Dylan McCall Approve
Review via email: mp+101891@code.launchpad.net

Description of the change

only return valid opportunities

To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

Can anyone help with reviewing these? :)

Revision history for this message
Dylan McCall (dylanmccall) wrote :

Is there a way to do this that doesn't use the object_name property? It bothers me a tiny bit because it's undocumented.

Not a big deal, though. It does do the job :)

Revision history for this message
Daniel Holbach (dholbach) wrote :

Hm, I tried around a bit, but couldn't find a better way to do it. Do you have a suggestion?

Revision history for this message
Dylan McCall (dylanmccall) wrote :

Yeah, I couldn't find anything either. Looks like this is fairly common, so I doubt Django will surprise us here.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'harvest/services/__init__.py'
2--- harvest/services/__init__.py 2012-04-11 16:47:39 +0000
3+++ harvest/services/__init__.py 2012-04-13 10:47:20 +0000
4@@ -75,6 +75,8 @@
5 if exclude is not None:
6 search_fields = [f for f in search_fields if f not in exclude]
7 search_values = dict([(str(key), value) for (key, value) in request.items()])
8+ if model._meta.object_name == 'Opportunity':
9+ search_values['valid'] = True
10
11 extra_arguments = {}
12 for key in search_values.keys():

Subscribers

People subscribed via source and target branches

to all changes: