Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lynn experiment #11

Open
wants to merge 107 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
cdb6189
manual merge of fulfillment name changes to be able to do more mutations
fosterlynn Aug 22, 2017
562736a
fix stupid import causing ci error
fosterlynn Sep 5, 2017
e9632ac
fix error when zero related projects
bum2 Sep 7, 2017
f709463
Merge branch 'master' of https://github.com/FreedomCoop/valuenetwork
bum2 Sep 7, 2017
580ec5f
projects menu if single relation without project or services
bum2 Sep 7, 2017
ee6e9e7
roughed out Plan using Order in models
fosterlynn Sep 7, 2017
4abc4f5
remove foreign key process to order (existing methods work)
fosterlynn Sep 7, 2017
fe1b805
Plan basic queries working.
fosterlynn Sep 7, 2017
73f76b8
made plan scope handle multiple agents
fosterlynn Sep 8, 2017
7db8e78
Merge branch 'master' of https://github.com/FreedomCoop/valuenetwork.…
fosterlynn Sep 8, 2017
fac5d4c
remove unwanted process methods
fosterlynn Sep 10, 2017
705a1f2
added action filter to process methods
fosterlynn Sep 10, 2017
d26adf4
tests running for last changes
fosterlynn Sep 10, 2017
1155907
changed plan.planned to plannedOn for consistency
fosterlynn Sep 10, 2017
e149cf3
fixed agentPlans bug, added to tests and samples
fosterlynn Sep 10, 2017
e3ad9d0
added ProcessClassification, other minor fixes
fosterlynn Sep 11, 2017
ec7e3e2
test for ProcessClassification
fosterlynn Sep 11, 2017
55b5d4d
Started work on plan resources (commented out).
fosterlynn Sep 14, 2017
6f67e51
input and output committed / actual resources just api
fosterlynn Sep 15, 2017
804b6ab
add order.all_incoming_commitments and
bhaugen Sep 15, 2017
3c7273b
Merge branch 'plan-io' of https://github.com/FreedomCoop/valuenetwork…
fosterlynn Sep 15, 2017
bab5893
add order.all_incoming_events and
bhaugen Sep 15, 2017
68e4e7b
Merge branch 'plan-io' of https://github.com/FreedomCoop/valuenetwork…
fosterlynn Sep 15, 2017
93f0cc3
commitment/event inputs/outputs for a plan
fosterlynn Sep 15, 2017
640e7f9
Merge branch 'api-extensions' into api-mutations-2
fosterlynn Sep 16, 2017
38d2b3a
fix modal form bugs in manufacturing recipes
bhaugen Sep 17, 2017
1cc8ba7
fix bug in workflow recipes
bhaugen Sep 17, 2017
3b805b8
fix bug where work/process-logging crashes
bhaugen Sep 19, 2017
b5a1eda
Added Plan create, update, delete (without connected logic)
fosterlynn Sep 20, 2017
048d614
mutations: fix commitment test samples, minimal check on delete plan
fosterlynn Sep 20, 2017
f216e66
EconomicEvent create and update mutations (still bug in delete)
fosterlynn Sep 20, 2017
1f085b1
fix bug in DeleteEconomicEvent
bhaugen Sep 22, 2017
9e2c03d
Partial implementation of additional logic for Process and Plan from …
fosterlynn Sep 22, 2017
2eec6ef
first draft of a generic EconomicEvent.update_resource method
bhaugen Sep 22, 2017
0dfcd55
started economic event mutations view logic
fosterlynn Sep 22, 2017
d09acfd
Merge branch 'api-extensions' of https://github.com/FreedomCoop/value…
fosterlynn Sep 22, 2017
ddbf425
Explain limitation of new update_resource method
bhaugen Sep 22, 2017
83e365d
cleanup of economic event mutations, radd fulfillment
fosterlynn Sep 23, 2017
0a9a80a
Merge branch 'api-extensions' of https://github.com/FreedomCoop/value…
fosterlynn Sep 23, 2017
41ae296
add new method EconomicEvent.delete_resource_effects()
bhaugen Sep 23, 2017
7bcf004
called resource effect of event, misc cleanup
fosterlynn Sep 23, 2017
b7c40c7
Merge branch 'api-extensions' of https://github.com/FreedomCoop/value…
fosterlynn Sep 23, 2017
751f7c4
economic event working with view logic: set process start, adjust res…
fosterlynn Sep 23, 2017
bb96487
EconomicResource mutations: no create, added create to EconomicEvent …
fosterlynn Sep 24, 2017
13313da
added new resource save logic for independent_demand hookup
fosterlynn Sep 24, 2017
6ba137e
for work event, use user agent if no provider
fosterlynn Sep 24, 2017
91ad62d
added requestDistribution to event; == is_contribution in model
fosterlynn Sep 24, 2017
9acc8ba
Merge branch 'api-mutations-4' into api-extensions
fosterlynn Sep 24, 2017
acd5e0c
fix error in resolving merge conflict
fosterlynn Sep 24, 2017
3484bf9
got conditions of changing resource in economic event working, also m…
fosterlynn Sep 26, 2017
2581043
added all order related fields to Commitment query
fosterlynn Sep 28, 2017
901521a
commitment mutations in progress
fosterlynn Sep 29, 2017
b1f0782
Merge branch 'fix-recipes' of https://github.com/FreedomCoop/valuenet…
fosterlynn Sep 29, 2017
c0a6384
commitment create mutation running except missing logic for creating …
fosterlynn Sep 29, 2017
31247d6
comment out adjustment code for change commitment, not working yet
fosterlynn Sep 29, 2017
5fa3952
remove order item from api input on Commitment
fosterlynn Sep 30, 2017
c38dfff
Merge pull request #368 from FreedomCoop/fix-recipes
bhaugen Sep 30, 2017
69f80e9
back out incomplete code put into api-extensions by mistake
fosterlynn Sep 30, 2017
c77907f
In process, update commitment connections
fosterlynn Sep 30, 2017
0ed3c3f
tweaks
fosterlynn Sep 30, 2017
cafa579
add a test for api commitment changes
bhaugen Oct 1, 2017
d981f99
Merge branch 'api-mutations-commit2' of https://github.com/FreedomCoo…
fosterlynn Oct 1, 2017
ae666d2
Merge branch 'master' of https://github.com/FreedomCoop/valuenetwork.…
fosterlynn Oct 1, 2017
099693d
Merge pull request #373 from FreedomCoop/work-process-bug
bhaugen Oct 6, 2017
8d1be02
resolve #374 - allow everybody to see all resource types
bhaugen Oct 6, 2017
09b2bed
undo last changes and redo them in a branch
bhaugen Oct 6, 2017
c19c1ca
Merge branch 'master' of https://github.com/FreedomCoop/valuenetwork
bhaugen Oct 6, 2017
6c245d3
Merge branch 'master' of https://github.com/FreedomCoop/valuenetwork.…
bhaugen Oct 6, 2017
713a839
Merge pull request #376 from FreedomCoop/all-resource-types
bhaugen Oct 6, 2017
910bca6
Basic authorization for mutations
fosterlynn Oct 6, 2017
a74480e
Place queries
fosterlynn Oct 9, 2017
376f63e
mappable_address >> address
fosterlynn Oct 10, 2017
89cfff1
added agent.primaryLocation and resource.currentLocation refs to Place
fosterlynn Oct 10, 2017
270ea47
Merge branch 'master' of https://github.com/FreedomCoop/valuenetwork
bum2 Oct 10, 2017
24caaae
Merge branch 'master' of https://github.com/FreedomCoop/valuenetwork
bhaugen Oct 10, 2017
0d6a5a0
warn when fobi form is not ready, try to fix agent form errors
bum2 Oct 11, 2017
e4d72db
fix bugs in faircoin distributions
bhaugen Oct 11, 2017
c9baec9
Merge pull request #378 from FreedomCoop/fix_distribution
bhaugen Oct 11, 2017
69ebc15
fix bleach to 2.0.0 to avoid the error after using 2.1.1
bum2 Oct 11, 2017
9673755
Merge branch 'master' of https://github.com/FreedomCoop/valuenetwork
bum2 Oct 11, 2017
43cf091
fix error when no POST in the request to transfer faircoins
bum2 Oct 18, 2017
56fd75e
save notes when sending faircoins
bum2 Oct 18, 2017
cd08a5f
Merge branch 'master' into api-extensions
fosterlynn Oct 18, 2017
b1e3af9
first draft of fake-kanban
bhaugen Oct 18, 2017
972d173
Merge pull request #382 from FreedomCoop/fake-kanban
bhaugen Oct 18, 2017
483569b
change links in fake-kanban to go to work app
bhaugen Oct 18, 2017
46ba9f7
add note if process is in other project
bhaugen Oct 18, 2017
b561856
Merge pull request #383 from FreedomCoop/fake-kanban-2
bhaugen Oct 18, 2017
a35434a
Merge branch 'master' of https://github.com/FreedomCoop/valuenetwork
bum2 Oct 19, 2017
b77f570
Merge branch 'master' of https://github.com/FreedomCoop/valuenetwork.…
fosterlynn Oct 20, 2017
7b59fe9
query for agent faircoin address
fosterlynn Oct 23, 2017
4f2e8e8
added isDeletable methods
fosterlynn Oct 23, 2017
ba88be5
peg file versions for graphene, now it compiles (but api does not run)
fosterlynn Oct 28, 2017
470b137
peg graphql-core version
fosterlynn Oct 28, 2017
06fae9b
in process: authorization in query (for feedback)
fosterlynn Nov 12, 2017
4e15f7c
temp hold
fosterlynn Nov 14, 2017
48bd762
add token user to context in
bhaugen Nov 30, 2017
b6589ae
Merge branch 'api-contr' of https://github.com/FreedomCoop/valuenetwo…
fosterlynn Nov 30, 2017
b52fef6
added query authorization for commitment, event, process
fosterlynn Nov 30, 2017
1272be9
Added references to resource.current_location
fosterlynn Dec 19, 2017
e8f33ca
space tweak
fosterlynn Dec 20, 2017
05d44af
added create date to resource, added filter to ownedEconomicResources…
fosterlynn Dec 21, 2017
1ecd94c
add sort to agent plans
fosterlynn Jan 14, 2018
32e4c9c
Made isFinished option for agentPlans work.
fosterlynn Jan 14, 2018
6460b08
Added gitignore for JetBrains IDES
ConnorHibbs Feb 8, 2018
1b669fe
Merge remote-tracking branch 'upstream/api-extensions' into api-exten…
ConnorHibbs Feb 8, 2018
bdeed9d
Merge branch 'api-extensions' of https://github.com/LearnDeepMilwauke…
fosterlynn Feb 9, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ local_settings.py
faircoin/faircoin.log*
faircoin/faircoin_cron.log*
.vagrant
.idea/
bin/
cmd/create-user.sh
include/
Expand Down
9 changes: 6 additions & 3 deletions faircoin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,12 @@ def transfer_faircoins(request, resource_id):
)
return HttpResponseRedirect('/%s/%s/'
% ('faircoin/faircoin-history', resource.id))

return HttpResponseRedirect('/%s/%s/'
% ('faircoin/manage-faircoin-account', resource.id))
else:
raise ValidationError(send_coins_form.errors)
else:
raise Http404
return HttpResponseRedirect('/%s/%s/'
% ('faircoin/manage-faircoin-account', resource.id))


@login_required
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ djangorestframework
jsonrpclib
django-contrib-comments
html5lib>0.99999999
bleach
bleach==2.0.0
django-simple-captcha
django-mptt
pytz
graphql-core==1.1
graphene==1.4
graphene-django==1.3
graphene==1.4.1
PyJWT
six
selenium
Expand Down
21 changes: 17 additions & 4 deletions valuenetwork/api/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.db import models

from valuenetwork.valueaccounting.models import Unit, EconomicEvent, Commitment
from valuenetwork.valueaccounting.models import Unit, EconomicEvent, Commitment, Location, EconomicAgent
from decimal import *

# Helpers for dealing with Agent polymorphism
Expand All @@ -12,6 +12,7 @@ def formatAgent(agent):
id=agent.id,
name = agent.name,
note = agent.description,
primary_location = agent.primary_location,
image = agent.image)
else:
return Organization(
Expand All @@ -20,6 +21,7 @@ def formatAgent(agent):
note = agent.description,
image = agent.image,
is_context = agent.is_context,
primary_location = agent.primary_location,
type = agent.agent_type)

def formatAgentList(agent_list):
Expand Down Expand Up @@ -47,6 +49,10 @@ class Organization(models.Model):
image = models.CharField(max_length=255, blank=True)
is_context = models.BooleanField(default=False)
type = models.CharField(max_length=255)
primary_location = models.ForeignKey(Location,
related_name='orgs_at_location',
blank=True, null=True,
on_delete=models.DO_NOTHING)

class Meta:
managed = False
Expand All @@ -59,18 +65,25 @@ class Person(models.Model):
image = models.CharField(max_length=255, blank=True)
is_context = models.BooleanField(default=False)
type = models.CharField(max_length=255, default="Person")
primary_location = models.ForeignKey(Location,
related_name='people_at_location',
blank=True, null=True,
on_delete=models.DO_NOTHING)

class Meta:
managed = False


class Fulfillment(models.Model):
fulfilled_by = models.ForeignKey(EconomicEvent,
related_name="fulfillments")
related_name="fulfillments",
on_delete=models.DO_NOTHING)
fulfills = models.ForeignKey(Commitment,
related_name="fulfillments")
related_name="fulfillments",
on_delete=models.DO_NOTHING)
fulfilled_quantity = models.ForeignKey(QuantityValue,
related_name="fulfillments")
related_name="fulfillments",
on_delete=models.DO_NOTHING)
note = models.TextField(blank=True, null=True)

class Meta:
Expand Down
15 changes: 13 additions & 2 deletions valuenetwork/api/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
import valuenetwork.api.schemas.EconomicEvent
import valuenetwork.api.schemas.QuantityValue
import valuenetwork.api.schemas.Unit
import valuenetwork.api.schemas.ResourceTaxonomyItem
import valuenetwork.api.schemas.ResourceClassification
import valuenetwork.api.schemas.ProcessClassification
import valuenetwork.api.schemas.Commitment
import valuenetwork.api.schemas.Plan
import valuenetwork.api.schemas.Place
from valuenetwork.api.schemas.helpers import hash_password


Expand All @@ -40,8 +43,11 @@ class ViewerQuery(
valuenetwork.api.schemas.EconomicEvent.Query,
valuenetwork.api.schemas.QuantityValue.Query,
valuenetwork.api.schemas.Unit.Query,
valuenetwork.api.schemas.ResourceTaxonomyItem.Query,
valuenetwork.api.schemas.ResourceClassification.Query,
valuenetwork.api.schemas.ProcessClassification.Query,
valuenetwork.api.schemas.Commitment.Query,
valuenetwork.api.schemas.Plan.Query,
valuenetwork.api.schemas.Place.Query,
graphene.ObjectType
):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -76,6 +82,11 @@ class Mutation(graphene.ObjectType):
create_economic_event = valuenetwork.api.schemas.EconomicEvent.CreateEconomicEvent.Field()
update_economic_event = valuenetwork.api.schemas.EconomicEvent.UpdateEconomicEvent.Field()
delete_economic_event = valuenetwork.api.schemas.EconomicEvent.DeleteEconomicEvent.Field()
create_plan = valuenetwork.api.schemas.Plan.CreatePlan.Field()
update_plan = valuenetwork.api.schemas.Plan.UpdatePlan.Field()
delete_plan = valuenetwork.api.schemas.Plan.DeletePlan.Field()
update_economic_resource = valuenetwork.api.schemas.EconomicResource.UpdateEconomicResource.Field()
delete_economic_resource = valuenetwork.api.schemas.EconomicResource.DeleteEconomicResource.Field()


schema = graphene.Schema(query=Query, mutation=Mutation)
12 changes: 7 additions & 5 deletions valuenetwork/api/schemas/Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@

class Query(graphene.AbstractType):

# define input query params

my_agent = graphene.Field(Agent)

agent = graphene.Field(Agent,
id=graphene.Int())

all_agents = graphene.List(Agent)

# load single agents
user_is_authorized_to_create = graphene.Boolean(scope_id=graphene.Int())


def resolve_my_agent(self, args, *rargs):
agentUser = AgentUser.objects.filter(user=self.user).first()
Expand All @@ -40,7 +39,10 @@ def resolve_agent(self, args, *rargs):
return formatAgent(agent)
raise PermissionDenied("Cannot find requested agent")

# load all agent lists

def resolve_all_agents(self, args, context, info):
return formatAgentList(EconomicAgent.objects.all())

def resolve_user_is_authorized_to_create(self, args, context, info):
context_agent_id = args.get('contest_agent_id')
user_agent = AgentUser.objects.filter(user=self.user).first().agent
return user_agent.is_authorized(context_agent_id=context_agent_id)
Loading