Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
47 views

How to use Depends and Path at the same time in FastAPI?

I have the following endpoint: @router.get('/events/{base_id}') def asd(base_id: common_input_types.event_id) -> None: do_something() And this is common_input_types.event_id: event_id = ...
Kulu's user avatar
  • 154
2 votes
1 answer
87 views

JQuery Validation conditions for Italian Fiscal Code and VAT number

I'm using the Jquery Validation plugin for my registration form. Users should enter an Italian VAT number ONLY if the company field is filled in, otherwise they should fill in the CF field. At the ...
user2505596's user avatar
0 votes
1 answer
484 views

Pydantic 2: "Input should be a valid list"

I'm using pydantic 2.5.1 with fastapi 0.103.2 and I got "Input should be a valid list" when trying to validate input using pydantic and dependency injection I tried this python code: class ...
rnuryadin's user avatar
0 votes
0 answers
29 views

How to create a fixture that will validate the user in the database when testing an API in FastAPI

There is an endpoint on adding a user to the database. We check if such a user already exists in the database (db_user = await get_user_by_email(email=user.email, session=session), the session is ...
Alexander Emelyanov's user avatar
1 vote
0 answers
67 views

Combining Dependencies in FastAPI using Sub-Dependencies

I would like to combine 2 Dependencies in FastAPI to implement Nested Model Following is the relevant code: def car_params(name: Union[str, None], brand: Union[str, None]): return {"name"...
curiouz's user avatar
  • 135
0 votes
0 answers
5 views

Running tests on both parallel and sequence mode using groups and dependsOnGroups attribute

I have a scenario, where in a single class file, i have multiple testcases, in that i want to run few tests in parallel and few in sequence, but sequence tests should execute only after the parallel ...
Sushmitha Venkatesh's user avatar
1 vote
1 answer
722 views

How to use Depends or similar thing as dependency injection outside of FastAPI request methods?

Can anybody tell me how to use dependency injection for my get_db() outside of the FastAPI routers methods? Apparently, Depends() only covers DI in request functions. Here's the get_db() async ...
Benyamin Jafari's user avatar
2 votes
0 answers
240 views

What are the advantages of using Depends in FastAPI?

I am studying the FastAPI framework and the principle of Dependency Injection, which is implemented in it using Depends. I have a question related to the expediency of using DI in those cases, which ...
fepex65885's user avatar
1 vote
2 answers
812 views

How to return multiple data/objects from a dependency function in FastAPI?

I am using FastAPI framework and writing some data into PostgreSQL database. The issue I am encountering is that I have a function get_current_user() that returns user credentials (including email), ...
user3324136's user avatar
1 vote
3 answers
487 views

FastAPI raises "TypeError: <generator object get_db at 0x00...> is not a callable object" when passing function to Depends

I get: File "C:\PythonProjects\myProject\routers\home.py", line 39, in @router.get("/home", response_class=HTMLResponse) ... raise TypeError('{!r} is not a callable object'....
sata mems's user avatar
1 vote
1 answer
2k views

"AttributeError: 'property' object has no attribute 'get'" when using Depends in FastAPI

To implement authentication for a FastAPI endpoint, I want to make use of the Depends functionality offered in the latest versions (>=0.95) of FastAPI. I have tried several ways to implement it but ...
Laurens Fleuren's user avatar
1 vote
1 answer
498 views

Secured endpoints in FastApi using enum

In my app, I want to apply access to a given endpoint based on a role, which is an enum. The way it all works is that a logged in (authorized) user, wants to get access to some resources, or create a ...
janluk's user avatar
  • 33
1 vote
1 answer
1k views

Why does FastAPI's Depends() work without any parameter passed to it?

I found the following FastAPI code for authenticating a user with their information gotten from a form: @app.post("/token") async def login_for_access_token(form_data:...
pablowilks2's user avatar
0 votes
0 answers
111 views

Can parameters depend on a parameter in a loop invariant in ada?

Please can you tell me whether or not the parameters (in or out or in out) and the depends clause, are correct for the rest of the program. Question: I am unsure if the loop invariant can 'use' a ...
Primo4151 's user avatar
2 votes
1 answer
1k views

Fastapi - need to use both Body and Depends as default value

I have an endpoint in in which the main body parameter was defined as follows: @router.post("/myendpoint") async def delete_objectss(param: DeleteItemParams = DeleteItemParamsMetadata, ...
Fabri Ba's user avatar
  • 173
1 vote
0 answers
764 views

Using Oauth2 with scope, error - "Depends" has no attribute "query" - FastAPI

authentication.py from datetime import datetime, timedelta from fastapi import Depends , HTTPException, status, Security from fastapi.security import OAuth2PasswordBearer, SecurityScopes from jose ...
Raj Mane's user avatar
0 votes
1 answer
289 views

pubspec.yaml have version solving issues. HTML, SVG, RANDOM AVTAR plugins have version issue

after upgrade flutter 3 I am facing this version solving issue. HTML version not sported SVG if I am choosing SVG different version so RANDOM_AVTAR is not sported. both plugin sported or dependent ...
sonalika's user avatar
  • 175
1 vote
1 answer
3k views

FastAPI Post request with database depends, object is not callable

For some reason, I am unable to pass a parameter and I get the following error, however, if I were to remove the string, everything behaves properly. If anyone else has come across a such an error ...
STY's user avatar
  • 113
0 votes
1 answer
60 views

Couldn't use gsheets flutter package

I made a flutter app and named it gsheets to test gsheets package and when I tried to download the package it said "Because gsheets depends on gsheets, version solving failed". After wasting ...
Ezzalarab Al-Homaidi's user avatar
3 votes
1 answer
4k views

Fastapi - run a function with dependencies outside of request

I have two functions that my code Depends on, also the second one depends on the first. def get_db() -> Iterable[sessionmaker]: db = SessionLocal() try: yield db finally: ...
Paweł Lis's user avatar
3 votes
2 answers
2k views

Invalid count argument in terraform

I have a module that contains the following code. resource "aws_s3_bucket" "main" { bucket = var.bucket_name acl = "private" tags = var.tags versioning { ...
gurpsone's user avatar
  • 483
3 votes
0 answers
2k views

FastAPI Depends use-case application

Let's consider the following code class CommonDependency: ... @app.on_event("startup") async def start(): parser = ArgumentParser(...) ... # here dep are init with command line ...
Antonio Santoro's user avatar
4 votes
0 answers
2k views

Depends efficiency in FastAPI

If you are application depends on some objects that needs to be initialized at startup, what's the point of using Depends mechanism to pass them to every route rather than create a global dict at ...
Antonio Santoro's user avatar
2 votes
2 answers
11k views

FastAPI: can I use Depends() for parameters in a POST, too?

Overview I have created a class-based dependency, similar to what is in the amazing FastAPI tutorial. Problem It works, except that the parameters in the dependency (the Depends() portion) are passed ...
Mike Williamson's user avatar
0 votes
1 answer
260 views

How to specify cookbook dependencies based on OS?

I am trying to find the best way of managing dependencies which are not available for all OS platforms. Our cookbook is cross-platform, it is aimed at both Linux and Windows systems. One of our recent ...
Geoff Harrison's user avatar
2 votes
1 answer
50 views

How to compute multiple levels in python Odoo

What's wrong with my code ? Requested: If A annd B are 0 show me result = A If A and B are not 0 then continue If C ID is 1 Do the equation Else if it's another ID then show me result = A Else of ...
Bilal Shehab's user avatar
0 votes
1 answer
318 views

Debian release specific control file

I am a bit confused about the question, Is it possible to control the package dependencies on Debian version specific? In control file we need to specify the dependencies in "Depends" field, So if we ...
Salah Uddin Ahmed's user avatar
7 votes
1 answer
17k views

Spring Boot - Load bean only if it is enabled by a property

I have a Spring Boot application with different submodules which also contains spring components. And in the main web modules I use 70% of the beans from the submodules. It depends on the application....
victorio's user avatar
  • 6,586
0 votes
1 answer
344 views

How can i get a specific item of a Selection field. Odoo 8

I need help in something what i want to achieve in Odoo 8. I have 2 selection. A and B. Depending on the value chosen in the selection A i need to show a specific value in the selection B. A piece of ...
Osmani's user avatar
  • 35
0 votes
1 answer
169 views

parameterized depends targets in ant

I am working on a ant build script to deploy jars. i.e. to just update the final/beta application jar in specified folder. Its checks if the deployed jar is already up-to-date. If yes, it skips ...
Kuldeep Singh's user avatar
20 votes
3 answers
21k views

How to start flyway after database initialization in Docker

I have following docker compose file(docker-compose-dev.yml): version: '3' services: my_sql_db: image: percona:latest container_name: my_sql_db environment: MYSQL_ROOT_PASSWORD: ...
gstackoverflow's user avatar
0 votes
1 answer
507 views

how can we change the state value in a depends method?

how can we change the state value in a @api.depends method ? I tried the return {'value':{'stat':'done'}} and self.state='done' didn't work then self.browse(self.id).write({'state':'done' }) worked ...
m3asmi's user avatar
  • 1,262
1 vote
1 answer
684 views

Chef Workflow fails on Verify stage when cookbook has dependencies

I am using the Workflow portion of Chef Automate to deliver cookbooks to my Chef Server. I have successfully uploaded 2 cookbooks on the Chef Server through the pipeline. On the Chef Server: apache ...
James's user avatar
  • 11
0 votes
0 answers
70 views

Using depends with ( "selector" ).rules( 'add', { .... } )

In my form the zipcode input comes before the State input. Therefore, I want to validate my zipcode only after my State input has been filled out. I have gotten the remote part to work. I have not ...
ermSO's user avatar
  • 335
1 vote
1 answer
7k views

"bitbake -g" vs. RDEPENDS

I wonder how bitbake -g is implemented. Probably it searches all recipes for DEPENDS=... occurrence, perhaps much more. How to get dependency graph however that one reflecting RDEPENDS=... relations?
user avatar
1 vote
1 answer
113 views

What is meant by an exe being dynamically compiled?

Came across the following paragraph from a page on the MySQL website here: You can write plugins in C or C++ (or another language that can use C calling conventions). Plugins are loaded and ...
Sabuncu's user avatar
  • 5,236
3 votes
1 answer
720 views

depends in phpunit doesn't seem to be working

Maybe it's just me but @depends doesn't seem to be working as I'd expect it to. My code: <?php use PHPUnit\Framework\TestCase; class MyTest extends TestCase { /* * @depends testFunc1 ...
neubert's user avatar
  • 16.6k
2 votes
2 answers
2k views

Yii2 location from dependencies in custom asset

I have a path something like /actions/users/someaction in the frontend and I want to use the Bootstrap-Asset (located in /backend/web/assets/xxxxxx/) from the backend. So I created an asset called "...
SlazZe's user avatar
  • 27
0 votes
1 answer
301 views

How can I define dependencies between INSTALLS targets in qmake?

I have several modules that I want to install (make install step) using qmake's INSTALLS: INSTALLS = module1 module2 module3. These install from different source folders, to same destination folder ...
mBardos's user avatar
  • 2,971
0 votes
1 answer
96 views

Dynamic menu configuration section with conditional inputs on Magento custom module

I've followed this tutorial to create a custom dynamic backend configuration with serialized data, and everything is working as expected. yay But now I want to take another step and only show some ...
Pablo's user avatar
  • 530
0 votes
0 answers
238 views

jquery validation required depends

I'm using https://jqueryvalidation.org to validate my form. Now I have an input for IBAN, which is not required, only if another field is filled. But WHEN it is required, I want to start the IBAN-...
MrLumbergh's user avatar
40 votes
3 answers
25k views

Dependency walker hangs

I have a problem with my.xll addin when it loads on my clients PC. It crashes Excel at startup (possible because of missing dependent dlls). I know it is possible to use dependency walker in profile ...
Damian's user avatar
  • 4,571
0 votes
1 answer
64 views

When is scons "Depends" useful when compiling c/cpp files?

Any c/cpp files can call functions defined in other module, only linking phase resolve them. These c/cpp files don't depend on each other for compiling sequence. So my question is, is there any case ...
Troskyvs's user avatar
  • 8,007
0 votes
0 answers
118 views

DLL cannot be found when I specify the path and the dll has no missing dependencies

I am writing a program which refers to a dll using the words "Declare" Whenever I run the program I get an error saying "File not found: x.dll". I tried specifying the whole path, still an error. I ...
Julio Garcia's user avatar
2 votes
1 answer
955 views

While using testng depends on method the method is skipped when the base method execution fails

I have a unique requirement where the method2 is dependent on method1. In method1, I am trying to generate some of the order data like placing the orders and storing the objects associated to order ...
user3172630's user avatar
0 votes
2 answers
87 views

Is there a function in R that return Package Depends, Imports and LinkingTo?

In CRAN, each package has Package Depends, Imports and LinkingTo http://cran.r-project.org/web/packages/Rcpp/index.html. Is there a build-in function or a function from an R package that can return ...
user1424739's user avatar
  • 13.2k
0 votes
1 answer
437 views

run target in ant that depends on jar

I have a jar target in ant that makes a jar out of two classes that I have. Then, I want to run this jar in another target that depends on the jar target. Would there be an easy way to do this in ...
John's user avatar
  • 145
1 vote
1 answer
196 views

Why success of build depends on folder name? (maven/selenium)

I have a project which does some selenium tests. The tests are located in "src/test/java" folder. When I try to build the project with maven (option: clean install) I get a build error. But when I ...
gartenkralle's user avatar
0 votes
1 answer
973 views

Order of execution of targets in NAnt

From the NAnt help page (http://nant.sourceforge.net/release/latest/help/fundamentals/targets.html): NAnt tries to execute the targets in the depends attribute in the order they appear from left ...
Nilay Vishwakarma's user avatar
0 votes
0 answers
739 views

jQuery .validate : Make a field required unless a false returned from remote

My mission is to make a field a required field, but if a ajax/remote call returns a false then to cancel that required field order. I have been playing about for days now trying to solve this. I have ...
Oliver Tsang's user avatar