Skip to content

Documentation and help with i18n #42

@goravbhootra

Description

@goravbhootra

Hi @liveforeverx,

Thank you for the fantastic library and amazing implementation of Dlex.Node. I am working on developing a LMS prototype - my first attempt at using a Graph database. I had to dig into Dlex code to understand the implementation. I intend to add documentation and may be a sample repo for anybody else wanting to use the library. I have done the following:

  • Implemented a Grepo module similar to Repo.ex for making calls to Dgraph. I may be using postgres in the project as well and hence, retained Repo for the purpose.
  • added Grepo to supervision tree.
  • implemented a the model (Course.ex) using Dlex.Node and the context (Courses.ex).
  • got CRUD action to work with a html view.
  • i18n feature in model - this is where I need help at the moment.
  • define associations in the models - needs update in Dlex for supporting [:uid] added in Dgraph v 1.1
  • define unique constraints on fields.
defmodule Lms.Courses.Course do
  use Dlex.Node
  @derive {Phoenix.Param, key: :uid}

  import Ecto.Changeset

  schema "courses" do
    field(:title, :string, index: ["term"])
    field(:description, :string)
    field(:duration_allowed, :integer)
   ...

how do I use title@en or other locales in this context?

any pointers to the pending items would be great help.

Best,
Gorav

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions