Questions tagged [lucid]

Lucid is the AdonisJS implementation of the active record pattern.

Lucid is the AdonisJS implementation of the active record pattern.

If you’re familiar with Laravel or Ruby on Rails, you’ll find many similarities between Lucid and Laravel’s Eloquent or Rails' Active Record.

Lucid documentation

31 questions
8
votes
1 answer

AdonisJS - How to return validation messages according to the locale of Antl Provider

I'm applying internationalization to my API and I'm having some issues related to Antl and validation messages. With standard response messages, I'm returning according to the locale set by the user. I created a route to switch locales and set to a…
Laura Beatris
  • 862
  • 3
  • 10
  • 32
5
votes
0 answers

How to import a keras model into lucid

The short version: I would like to visualize a keras model in lucid, and fail to transform the model into a format lucid would accept. The long version: I would like to play around with lucid exploring a simple model built in keras (CNN for MNIST…
Peter
  • 51
  • 1
3
votes
1 answer

How to calculate the 3x3 covariance matrix for RGB values across an image dataset?

I need to calculate the covariance matrix for RGB values across an image dataset, and then apply Cholesky decomposition to the final result. The covariance matrix for RGB values is a 3x3 matrix M, where M_(i, i) is the variance of channel i and…
ProGamerGov
  • 614
  • 6
  • 16
3
votes
1 answer

How to use Lucid Interpretability tools on a Tensorflow Detection model?

I want to use Lucid to analyze the feature extraction of a detection model I trained using the tensorflow Object Detection API on my own dataset. The model used is one from the Tensorflow Object Detection Zoo, namely faster_rcnn_resnet101. I…
2
votes
2 answers

How can I automatically append a property from a relation to the root object?

How can I automatically append a property from a relation to the root object, as if it were a column from the same table but actually it is coming from another table. Supose I have an User model that hasMany Emails. How can I only append the email…
e200
  • 668
  • 6
  • 22
1
vote
0 answers

Many to Many query on Lucid models, AdonisJs

Consider a simple situation of users and subjects related with a pivot table named user_subjects, now if I have to fetch all the users who have opted for a certain subject. What is the best way to achieve this in AdonisJs 5. Following is the…
Kushagra Saxena
  • 594
  • 4
  • 13
1
vote
1 answer

Can't add a new key to object inside an array

I am a newbie in TypeScript const conversations = await Conversation .query() .whereRaw("FIND_IN_SET(" + user_id + ", participants)") .orderBy("last_message_timestamp", "desc") …
Utku Dalmaz
  • 8,375
  • 27
  • 83
  • 122
1
vote
0 answers

Getting error while storing data in db using adonis

I am using below code to put my row details through post request in db but error is coming: (insert into `product` (`created_at`, `description`, `id`, `image`,`pages`, `title`, `updated_at`) values ('2021-02-14 02:44:52', 'sddsds', 12, 'image',…
1
vote
1 answer

AdonisJS 5 - preload model even if foreign key is null

I want to preload a model even if it have a null foreign key. I'll use the models from Adonis docs page to ilustrate: User and Profile. const user = await User.query().preload("profile") Simple as that! But in my case, if a user have the key…
tomrlh
  • 845
  • 14
  • 27
1
vote
1 answer

Adonis.js : How to select some attribute in query using Lucid Models

I wanna select some attribute in my query. This is my code in controllers const Category = use('App/Models/Category') class CategoryController { async getCategories({request,response}) { try { let categories = await…
atjab
  • 59
  • 6
1
vote
1 answer

Cannot update Datetime type value with Lucid in AdonisJS

I cannot update a datetime type value in a table. (VIGENCIA) I`m using AdonisJS and Lucid models, and MySQL, but no matter what i try it remains the same. Sorry for english second language. const user = await auth.getUser(); const pack = await…
1
vote
1 answer

How i can make a create() method using a instance of my model in adonis /node.js?

I'm trying to make a insert using Lucid Models. So, first i define my model in a const: const ClasseLivroHistorico = use('App/Models/ClassBookHistoric') This is my function that needs to create a new record: async…
bla
  • 667
  • 4
  • 19
1
vote
0 answers

Can Lucid visualize MobileNet V3 Squeeze/Excite blocks

I've trained a number of graphs using the provided MobileNet V3 definition (small) but when I run (tensorflow) Lucid to generate visualisations Lucid fails with an error. If I modify the definition to exclude the Squeeze/Excite blocks then the…
1
vote
2 answers

Loading `belongsToMany` relation using the `with` method always returning an empty array

I have 2 models, Person and PersonType with a belongsToMany relation. The problem is that when I try to get all the PersonTypes related to a Person using the query().with() method, it is always returning an empty array even if I have the right data…
e200
  • 668
  • 6
  • 22
0
votes
1 answer

Adonisjs How to cast boolean to false and true in a model instead of 0 or 1?

This is my table field (open) but in response, it returns 0 1 but I want true false instead of 0 1 I am using adonis MySQL table.boolean('open').notNullable().defaultTo(true).comment('true = open, false = close') const Model = use('Model') class…
1
2 3