Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

local API incomplete JSON files #65

Open
dylanwal opened this issue Nov 29, 2022 · 0 comments
Open

local API incomplete JSON files #65

dylanwal opened this issue Nov 29, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@dylanwal
Copy link
Contributor

The issue is url, uid, created_at, updated_at is not being added to User, Group, Project, Experiment nodes when using the local API.

code:

import cript as c

def main():
    api = c.APILocal('database')

    user = c.User(username="UserName", email="[email protected]")
    user.save()

    group = c.Group(name="NewGroup", users=[user])
    group.save()

    proj = c.Project(name="MyProject")
    proj.save()

    coll = c.Collection.create(project=proj, name="MyCollection")
    coll.save()

    expt = c.Experiment(collection=coll, name="Polymerization")
    expt.save()


if __name__ == "__main__":
    main()

output JSON for User:

{
    "url": null, 
    "uid": null,
    "public": false,
    "created_at": null,
    "updated_at": null,
    "username": "UserName",
    "email": "[email protected]",
    "orcid_id": null,
    "groups": []
}

Issue: url, uid, created_at, updated_at should be filled out.
This issue happens with User, Group, Project, Experiment


Collection is good!

{
    "url": "http://localhost/api/collection/8f467f46-b1fd-4971-81a6-af54cc32fb4a/",
    "uid": "8f467f46-b1fd-4971-81a6-af54cc32fb4a",
    "public": false,
    "created_at": "2022-11-29T10:10:46.558796",
    "updated_at": "2022-11-29T10:10:46.558796",
    "project": "http://localhost/api/project/6b764f1b-3eea-4b9a-b806-765f2fbdbd48/",
    "name": "MyCollection",
    "citations": [],
    "notes": null,
    "group": null
}
@dylanwal dylanwal added the bug Something isn't working label Nov 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant