{"action":"created","comment":{"url":"https://api.github.com/repos/rolandgeider/wger/pulls/comments/45584096","id":45584096,"diff_hunk":"@@ -415,3 +437,43 @@\n \n         # Bulk-create the weight entries\n         WeightEntry.objects.bulk_create(new_entries)\n+\n+# Nutrition Generator\n+if hasattr(args, 'number_nutrition_plans'):\n+    print(\"** Generating {0} nutrition plan(s) per user\".format(args.number_nutrition_plans))\n+\n+    if args.add_to_user:\n+        userlist = [User.objects.get(pk=args.add_to_user)]\n+    else:\n+        userlist = [i for i in User.objects.all()]\n+\n+    # Load all ingredients to a list\n+    ingredientList = [i for i in Ingredient.objects.all()]\n+\n+    # Total meals per plan\n+    total_meals = 4\n+    \n+    for user in userlist:\n+        print('   - generating for {0}'.format(user.username))\n+\n+        # Add nutrition plan\n+        for i in range(0, args.number_nutrition_plans):\n+            uid = str(uuid.uuid4()).split('-')\n+            start_date = datetime.date.today() - datetime.timedelta(days=random.randint(0, 100))\n+            nutrition_plan = NutritionPlan(language=Language.objects.all()[1], description='Dummy nutrition plan - {0}'.format(uid[1]),\n+                              creation_date=start_date)\n+            nutrition_plan.user = user\n+\n+            nutrition_plan.save()\n+\n+            # Add meals to plan\n+            order = 1\n+            for j in range(0, total_meals):\n+               meal = Meal(plan=nutrition_plan, order=order)\n+               meal.save()\n+               ingredient = ingredientList[random.randint(0, len(ingredientList))]","path":"extras/dummy_generator/generator.py","position":74,"original_position":74,"commit_id":"bcc471d0b8a6ca62509267cade843a4594fd72f7","original_commit_id":"bcc471d0b8a6ca62509267cade843a4594fd72f7","user":{"login":"rolandgeider","id":2280729,"avatar_url":"https://avatars.githubusercontent.com/u/2280729?v=3","gravatar_id":"","url":"https://api.github.com/users/rolandgeider","html_url":"https://github.com/rolandgeider","followers_url":"https://api.github.com/users/rolandgeider/followers","following_url":"https://api.github.com/users/rolandgeider/following{/other_user}","gists_url":"https://api.github.com/users/rolandgeider/gists{/gist_id}","starred_url":"https://api.github.com/users/rolandgeider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rolandgeider/subscriptions","organizations_url":"https://api.github.com/users/rolandgeider/orgs","repos_url":"https://api.github.com/users/rolandgeider/repos","events_url":"https://api.github.com/users/rolandgeider/events{/privacy}","received_events_url":"https://api.github.com/users/rolandgeider/received_events","type":"User","site_admin":false},"body":"You can add another for loop here and add a random number of ingredients to the meal, perhaps something between 1 and 5?","created_at":"2015-11-23T09:35:36Z","updated_at":"2015-11-23T09:35:36Z","html_url":"https://github.com/rolandgeider/wger/pull/245#discussion_r45584096","pull_request_url":"https://api.github.com/repos/rolandgeider/wger/pulls/245","_links":{"self":{"href":"https://api.github.com/repos/rolandgeider/wger/pulls/comments/45584096"},"html":{"href":"https://github.com/rolandgeider/wger/pull/245#discussion_r45584096"},"pull_request":{"href":"https://api.github.com/repos/rolandgeider/wger/pulls/245"}}},"pull_request":{"url":"https://api.github.com/repos/rolandgeider/wger/pulls/245","id":51486961,"html_url":"https://github.com/rolandgeider/wger/pull/245","diff_url":"https://github.com/rolandgeider/wger/pull/245.diff","patch_url":"https://github.com/rolandgeider/wger/pull/245.patch","issue_url":"https://api.github.com/repos/rolandgeider/wger/issues/245","number":245,"state":"open","locked":false,"title":"Possible fix for issue #241","user":{"login":"cthare","id":8977591,"avatar_url":"https://avatars.githubusercontent.com/u/8977591?v=3","gravatar_id":"","url":"https://api.github.com/users/cthare","html_url":"https://github.com/cthare","followers_url":"https://api.github.com/users/cthare/followers","following_url":"https://api.github.com/users/cthare/following{/other_user}","gists_url":"https://api.github.com/users/cthare/gists{/gist_id}","starred_url":"https://api.github.com/users/cthare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cthare/subscriptions","organizations_url":"https://api.github.com/users/cthare/orgs","repos_url":"https://api.github.com/users/cthare/repos","events_url":"https://api.github.com/users/cthare/events{/privacy}","received_events_url":"https://api.github.com/users/cthare/received_events","type":"User","site_admin":false},"body":"I'm a bit new to working on larger projects and open source in general. I think I may have solved #241.","created_at":"2015-11-23T04:21:07Z","updated_at":"2015-11-23T09:35:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c930baefb54f8ec8f40610ea4afe6e5d9805e99c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rolandgeider/wger/pulls/245/commits","review_comments_url":"https://api.github.com/repos/rolandgeider/wger/pulls/245/comments","review_comment_url":"https://api.github.com/repos/rolandgeider/wger/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rolandgeider/wger/issues/245/comments","statuses_url":"https://api.github.com/repos/rolandgeider/wger/statuses/bcc471d0b8a6ca62509267cade843a4594fd72f7","head":{"label":"cthare:master","ref":"master","sha":"bcc471d0b8a6ca62509267cade843a4594fd72f7","user":{"login":"cthare","id":8977591,"avatar_url":"https://avatars.githubusercontent.com/u/8977591?v=3","gravatar_id":"","url":"https://api.github.com/users/cthare","html_url":"https://github.com/cthare","followers_url":"https://api.github.com/users/cthare/followers","following_url":"https://api.github.com/users/cthare/following{/other_user}","gists_url":"https://api.github.com/users/cthare/gists{/gist_id}","starred_url":"https://api.github.com/users/cthare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cthare/subscriptions","organizations_url":"https://api.github.com/users/cthare/orgs","repos_url":"https://api.github.com/users/cthare/repos","events_url":"https://api.github.com/users/cthare/events{/privacy}","received_events_url":"https://api.github.com/users/cthare/received_events","type":"User","site_admin":false},"repo":{"id":46696009,"name":"wger","full_name":"cthare/wger","owner":{"login":"cthare","id":8977591,"avatar_url":"https://avatars.githubusercontent.com/u/8977591?v=3","gravatar_id":"","url":"https://api.github.com/users/cthare","html_url":"https://github.com/cthare","followers_url":"https://api.github.com/users/cthare/followers","following_url":"https://api.github.com/users/cthare/following{/other_user}","gists_url":"https://api.github.com/users/cthare/gists{/gist_id}","starred_url":"https://api.github.com/users/cthare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cthare/subscriptions","organizations_url":"https://api.github.com/users/cthare/orgs","repos_url":"https://api.github.com/users/cthare/repos","events_url":"https://api.github.com/users/cthare/events{/privacy}","received_events_url":"https://api.github.com/users/cthare/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cthare/wger","description":"FLOSS workout, fitness and weight manager/tracker written with Django","fork":true,"url":"https://api.github.com/repos/cthare/wger","forks_url":"https://api.github.com/repos/cthare/wger/forks","keys_url":"https://api.github.com/repos/cthare/wger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cthare/wger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cthare/wger/teams","hooks_url":"https://api.github.com/repos/cthare/wger/hooks","issue_events_url":"https://api.github.com/repos/cthare/wger/issues/events{/number}","events_url":"https://api.github.com/repos/cthare/wger/events","assignees_url":"https://api.github.com/repos/cthare/wger/assignees{/user}","branches_url":"https://api.github.com/repos/cthare/wger/branches{/branch}","tags_url":"https://api.github.com/repos/cthare/wger/tags","blobs_url":"https://api.github.com/repos/cthare/wger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cthare/wger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cthare/wger/git/refs{/sha}","trees_url":"https://api.github.com/repos/cthare/wger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cthare/wger/statuses/{sha}","languages_url":"https://api.github.com/repos/cthare/wger/languages","stargazers_url":"https://api.github.com/repos/cthare/wger/stargazers","contributors_url":"https://api.github.com/repos/cthare/wger/contributors","subscribers_url":"https://api.github.com/repos/cthare/wger/subscribers","subscription_url":"https://api.github.com/repos/cthare/wger/subscription","commits_url":"https://api.github.com/repos/cthare/wger/commits{/sha}","git_commits_url":"https://api.github.com/repos/cthare/wger/git/commits{/sha}","comments_url":"https://api.github.com/repos/cthare/wger/comments{/number}","issue_comment_url":"https://api.github.com/repos/cthare/wger/issues/comments{/number}","contents_url":"https://api.github.com/repos/cthare/wger/contents/{+path}","compare_url":"https://api.github.com/repos/cthare/wger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cthare/wger/merges","archive_url":"https://api.github.com/repos/cthare/wger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cthare/wger/downloads","issues_url":"https://api.github.com/repos/cthare/wger/issues{/number}","pulls_url":"https://api.github.com/repos/cthare/wger/pulls{/number}","milestones_url":"https://api.github.com/repos/cthare/wger/milestones{/number}","notifications_url":"https://api.github.com/repos/cthare/wger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cthare/wger/labels{/name}","releases_url":"https://api.github.com/repos/cthare/wger/releases{/id}","created_at":"2015-11-23T04:11:24Z","updated_at":"2015-11-23T04:11:28Z","pushed_at":"2015-11-23T04:15:57Z","git_url":"git://github.com/cthare/wger.git","ssh_url":"git@github.com:cthare/wger.git","clone_url":"https://github.com/cthare/wger.git","svn_url":"https://github.com/cthare/wger","homepage":"https://wger.de","size":21791,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rolandgeider:master","ref":"master","sha":"1fa288876ccfc9cfa666729768e2952445786508","user":{"login":"rolandgeider","id":2280729,"avatar_url":"https://avatars.githubusercontent.com/u/2280729?v=3","gravatar_id":"","url":"https://api.github.com/users/rolandgeider","html_url":"https://github.com/rolandgeider","followers_url":"https://api.github.com/users/rolandgeider/followers","following_url":"https://api.github.com/users/rolandgeider/following{/other_user}","gists_url":"https://api.github.com/users/rolandgeider/gists{/gist_id}","starred_url":"https://api.github.com/users/rolandgeider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rolandgeider/subscriptions","organizations_url":"https://api.github.com/users/rolandgeider/orgs","repos_url":"https://api.github.com/users/rolandgeider/repos","events_url":"https://api.github.com/users/rolandgeider/events{/privacy}","received_events_url":"https://api.github.com/users/rolandgeider/received_events","type":"User","site_admin":false},"repo":{"id":7705569,"name":"wger","full_name":"rolandgeider/wger","owner":{"login":"rolandgeider","id":2280729,"avatar_url":"https://avatars.githubusercontent.com/u/2280729?v=3","gravatar_id":"","url":"https://api.github.com/users/rolandgeider","html_url":"https://github.com/rolandgeider","followers_url":"https://api.github.com/users/rolandgeider/followers","following_url":"https://api.github.com/users/rolandgeider/following{/other_user}","gists_url":"https://api.github.com/users/rolandgeider/gists{/gist_id}","starred_url":"https://api.github.com/users/rolandgeider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rolandgeider/subscriptions","organizations_url":"https://api.github.com/users/rolandgeider/orgs","repos_url":"https://api.github.com/users/rolandgeider/repos","events_url":"https://api.github.com/users/rolandgeider/events{/privacy}","received_events_url":"https://api.github.com/users/rolandgeider/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rolandgeider/wger","description":"FLOSS workout, fitness and weight manager/tracker written with Django","fork":false,"url":"https://api.github.com/repos/rolandgeider/wger","forks_url":"https://api.github.com/repos/rolandgeider/wger/forks","keys_url":"https://api.github.com/repos/rolandgeider/wger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rolandgeider/wger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rolandgeider/wger/teams","hooks_url":"https://api.github.com/repos/rolandgeider/wger/hooks","issue_events_url":"https://api.github.com/repos/rolandgeider/wger/issues/events{/number}","events_url":"https://api.github.com/repos/rolandgeider/wger/events","assignees_url":"https://api.github.com/repos/rolandgeider/wger/assignees{/user}","branches_url":"https://api.github.com/repos/rolandgeider/wger/branches{/branch}","tags_url":"https://api.github.com/repos/rolandgeider/wger/tags","blobs_url":"https://api.github.com/repos/rolandgeider/wger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rolandgeider/wger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rolandgeider/wger/git/refs{/sha}","trees_url":"https://api.github.com/repos/rolandgeider/wger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rolandgeider/wger/statuses/{sha}","languages_url":"https://api.github.com/repos/rolandgeider/wger/languages","stargazers_url":"https://api.github.com/repos/rolandgeider/wger/stargazers","contributors_url":"https://api.github.com/repos/rolandgeider/wger/contributors","subscribers_url":"https://api.github.com/repos/rolandgeider/wger/subscribers","subscription_url":"https://api.github.com/repos/rolandgeider/wger/subscription","commits_url":"https://api.github.com/repos/rolandgeider/wger/commits{/sha}","git_commits_url":"https://api.github.com/repos/rolandgeider/wger/git/commits{/sha}","comments_url":"https://api.github.com/repos/rolandgeider/wger/comments{/number}","issue_comment_url":"https://api.github.com/repos/rolandgeider/wger/issues/comments{/number}","contents_url":"https://api.github.com/repos/rolandgeider/wger/contents/{+path}","compare_url":"https://api.github.com/repos/rolandgeider/wger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rolandgeider/wger/merges","archive_url":"https://api.github.com/repos/rolandgeider/wger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rolandgeider/wger/downloads","issues_url":"https://api.github.com/repos/rolandgeider/wger/issues{/number}","pulls_url":"https://api.github.com/repos/rolandgeider/wger/pulls{/number}","milestones_url":"https://api.github.com/repos/rolandgeider/wger/milestones{/number}","notifications_url":"https://api.github.com/repos/rolandgeider/wger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rolandgeider/wger/labels{/name}","releases_url":"https://api.github.com/repos/rolandgeider/wger/releases{/id}","created_at":"2013-01-19T16:34:38Z","updated_at":"2015-11-23T04:59:31Z","pushed_at":"2015-11-23T04:21:08Z","git_url":"git://github.com/rolandgeider/wger.git","ssh_url":"git@github.com:rolandgeider/wger.git","clone_url":"https://github.com/rolandgeider/wger.git","svn_url":"https://github.com/rolandgeider/wger","homepage":"https://wger.de","size":21806,"stargazers_count":178,"watchers_count":178,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":50,"mirror_url":null,"open_issues_count":69,"forks":50,"open_issues":69,"watchers":178,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rolandgeider/wger/pulls/245"},"html":{"href":"https://github.com/rolandgeider/wger/pull/245"},"issue":{"href":"https://api.github.com/repos/rolandgeider/wger/issues/245"},"comments":{"href":"https://api.github.com/repos/rolandgeider/wger/issues/245/comments"},"review_comments":{"href":"https://api.github.com/repos/rolandgeider/wger/pulls/245/comments"},"review_comment":{"href":"https://api.github.com/repos/rolandgeider/wger/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rolandgeider/wger/pulls/245/commits"},"statuses":{"href":"https://api.github.com/repos/rolandgeider/wger/statuses/bcc471d0b8a6ca62509267cade843a4594fd72f7"}}}}