Skip to content

Commit 6a943ea

Browse files
tsabschroman-right
andauthored
Fix broken links (#665)
* Fix broken link Uses relative links instead of hardcoded URLs. * remove inheritance doc from the Document docstring * remove inheritance doc from the query classes --------- Co-authored-by: Roman <[email protected]>
1 parent 6b3a7e6 commit 6a943ea

15 files changed

+37
-76
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Contributing
22
------------
33

4-
Please check [this page in the documentation](https://roman-right.github.io/beanie/development/).
4+
Please check [this page in the documentation](https://beanie-odm.dev/development/).

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Beanie](https://raw.githubusercontent.com/roman-right/beanie/main/assets/logo/white_bg.svg)](https://github.com/roman-right/beanie)
22

3-
[![shields badge](https://shields.io/badge/-docs-blue)](https://roman-right.github.io/beanie/)
3+
[![shields badge](https://shields.io/badge/-docs-blue)](https://beanie-odm.dev)
44
[![pypi](https://img.shields.io/pypi/v/beanie.svg)](https://pypi.python.org/pypi/beanie)
55

66
## Overview
@@ -85,7 +85,7 @@ if __name__ == "__main__":
8585

8686
### Documentation
8787

88-
- **[Doc](https://roman-right.github.io/beanie/)** - Tutorial, API documentation, and development guidelines.
88+
- **[Doc](https://beanie-odm.dev/)** - Tutorial, API documentation, and development guidelines.
8989

9090
### Example Projects
9191

@@ -109,7 +109,7 @@ Iliya Hosseini](https://github.com/IHosseini083)
109109

110110
- **[GitHub](https://github.com/roman-right/beanie)** - GitHub page of the
111111
project
112-
- **[Changelog](https://roman-right.github.io/beanie/changelog)** - list of all
112+
- **[Changelog](https://beanie-odm.dev/changelog)** - list of all
113113
the valuable changes
114114
- **[Discord](https://discord.gg/29mMrEBvr4)** - ask your questions, share
115115
ideas or just say `Hello!!`

beanie/odm/documents.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,6 @@ class Document(
137137
138138
- `id` - MongoDB document ObjectID "_id" field.
139139
Mapped to the PydanticObjectId class
140-
141-
Inherited from:
142-
143-
- Pydantic BaseModel
144-
- [UpdateMethods](https://roman-right.github.io/beanie/api/interfaces/#aggregatemethods)
145140
"""
146141

147142
if IS_PYDANTIC_V2:
@@ -732,7 +727,7 @@ class Sample(Document):
732727
733728
```
734729
735-
Uses [Set operator](https://roman-right.github.io/beanie/api/operators/update/#set)
730+
Uses [Set operator](operators/update.md#set)
736731
737732
:param expression: Dict[Union[ExpressionField, str], Any] - keys and
738733
values to set
@@ -760,7 +755,7 @@ def current_date(
760755
"""
761756
Set current date
762757
763-
Uses [CurrentDate operator](https://roman-right.github.io/beanie/api/operators/update/#currentdate)
758+
Uses [CurrentDate operator](operators/update.md#currentdate)
764759
765760
:param expression: Dict[Union[ExpressionField, str], Any]
766761
:param session: Optional[ClientSession] - pymongo session
@@ -798,7 +793,7 @@ class Sample(Document):
798793
799794
```
800795
801-
Uses [Inc operator](https://roman-right.github.io/beanie/api/operators/update/#inc)
796+
Uses [Inc operator](operators/update.md#inc)
802797
803798
:param expression: Dict[Union[ExpressionField, str], Any]
804799
:param session: Optional[ClientSession] - pymongo session

beanie/odm/interfaces/aggregate.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ def aggregate(
5555
]:
5656
"""
5757
Aggregate over collection.
58-
Returns [AggregationQuery](https://roman-right.github.io/beanie/api/queries/#aggregationquery) query object
58+
Returns [AggregationQuery](query.md#aggregationquery) query object
5959
:param aggregation_pipeline: list - aggregation pipeline
6060
:param projection_model: Type[BaseModel]
6161
:param session: Optional[ClientSession]
6262
:param ignore_cache: bool
6363
:param **pymongo_kwargs: pymongo native parameters for aggregate operation
64-
:return: [AggregationQuery](https://roman-right.github.io/beanie/api/queries/#aggregationquery)
64+
:return: [AggregationQuery](query.md#aggregationquery)
6565
"""
6666
return cls.find_all().aggregate(
6767
aggregation_pipeline=aggregation_pipeline,

beanie/odm/interfaces/find.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ def find_one( # type: ignore
9191
) -> Union[FindOne["DocType"], FindOne["DocumentProjectionType"]]:
9292
"""
9393
Find one document by criteria.
94-
Returns [FindOne](https://roman-right.github.io/beanie/api/queries/#findone) query object.
94+
Returns [FindOne](query.md#findone) query object.
9595
When awaited this will either return a document or None if no document exists for the search criteria.
9696
9797
:param args: *Mapping[str, Any] - search criteria
9898
:param projection_model: Optional[Type[BaseModel]] - projection model
9999
:param session: Optional[ClientSession] - pymongo session instance
100100
:param ignore_cache: bool
101101
:param **pymongo_kwargs: pymongo native parameters for find operation (if Document class contains links, this parameter must fit the respective parameter of the aggregate MongoDB function)
102-
:return: [FindOne](https://roman-right.github.io/beanie/api/queries/#findone) - find query instance
102+
:return: [FindOne](query.md#findone) - find query instance
103103
"""
104104
args = cls._add_class_id_filter(args, with_children)
105105
return cls._find_one_query_class(document_model=cls).find_one(
@@ -164,7 +164,7 @@ def find_many( # type: ignore
164164
) -> Union[FindMany["DocType"], FindMany["DocumentProjectionType"]]:
165165
"""
166166
Find many documents by criteria.
167-
Returns [FindMany](https://roman-right.github.io/beanie/api/queries/#findmany) query object
167+
Returns [FindMany](query.md#findmany) query object
168168
169169
:param args: *Mapping[str, Any] - search criteria
170170
:param skip: Optional[int] - The number of documents to omit.
@@ -175,7 +175,7 @@ def find_many( # type: ignore
175175
:param ignore_cache: bool
176176
:param lazy_parse: bool
177177
:param **pymongo_kwargs: pymongo native parameters for find operation (if Document class contains links, this parameter must fit the respective parameter of the aggregate MongoDB function)
178-
:return: [FindMany](https://roman-right.github.io/beanie/api/queries/#findmany) - query instance
178+
:return: [FindMany](query.md#findmany) - query instance
179179
"""
180180
args = cls._add_class_id_filter(args, with_children)
181181
return cls._find_many_query_class(document_model=cls).find_many(
@@ -313,7 +313,7 @@ def find_all( # type: ignore
313313
:param projection_model: Optional[Type[BaseModel]] - projection model
314314
:param session: Optional[ClientSession] - pymongo session
315315
:param **pymongo_kwargs: pymongo native parameters for find operation (if Document class contains links, this parameter must fit the respective parameter of the aggregate MongoDB function)
316-
:return: [FindMany](https://roman-right.github.io/beanie/api/queries/#findmany) - query instance
316+
:return: [FindMany](query.md#findmany) - query instance
317317
"""
318318
return cls.find_many(
319319
{},

beanie/odm/interfaces/update.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Sample(Document):
4848
4949
```
5050
51-
Uses [Set operator](https://roman-right.github.io/beanie/api/operators/update/#set)
51+
Uses [Set operator](operators/update.md#set)
5252
5353
:param expression: Dict[Union[ExpressionField, str], Any] - keys and
5454
values to set
@@ -70,7 +70,7 @@ def current_date(
7070
"""
7171
Set current date
7272
73-
Uses [CurrentDate operator](https://roman-right.github.io/beanie/api/operators/update/#currentdate)
73+
Uses [CurrentDate operator](operators/update.md#currentdate)
7474
7575
:param expression: Dict[Union[ExpressionField, str], Any]
7676
:param session: Optional[ClientSession] - pymongo session
@@ -105,7 +105,7 @@ class Sample(Document):
105105
106106
```
107107
108-
Uses [Inc operator](https://roman-right.github.io/beanie/api/operators/update/#inc)
108+
Uses [Inc operator](operators/update.md#inc)
109109
110110
:param expression: Dict[Union[ExpressionField, str], Any]
111111
:param session: Optional[ClientSession] - pymongo session

beanie/odm/queries/aggregation.py

-5
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ class AggregationQuery(
3333
):
3434
"""
3535
Aggregation Query
36-
37-
Inherited from:
38-
39-
- [SessionMethods](https://roman-right.github.io/beanie/api/interfaces/#sessionmethods) - session methods
40-
- [BaseCursorQuery](https://roman-right.github.io/beanie/api/queries/#basecursorquery) - async generator
4136
"""
4237

4338
def __init__(

beanie/odm/queries/find.py

+10-26
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ class FindQuery(
6363
):
6464
"""
6565
Find Query base class
66-
67-
Inherited from:
68-
69-
- [SessionMethods](https://roman-right.github.io/beanie/api/interfaces/#sessionmethods)
70-
- [UpdateMethods](https://roman-right.github.io/beanie/api/interfaces/#aggregatemethods)
7166
"""
7267

7368
UpdateQueryType: Union[
@@ -173,13 +168,6 @@ class FindMany(
173168
):
174169
"""
175170
Find Many query class
176-
177-
Inherited from:
178-
179-
- [FindQuery](https://roman-right.github.io/beanie/api/queries/#findquery)
180-
- [BaseCursorQuery](https://roman-right.github.io/beanie/api/queries/#basecursorquery) - async generator
181-
- [AggregateMethods](https://roman-right.github.io/beanie/api/interfaces/#aggregatemethods)
182-
183171
"""
184172

185173
UpdateQueryType = UpdateMany
@@ -487,11 +475,11 @@ def update_many(
487475
) -> UpdateMany:
488476
"""
489477
Provide search criteria to the
490-
[UpdateMany](https://roman-right.github.io/beanie/api/queries/#updatemany) query
478+
[UpdateMany](query.md#updatemany) query
491479
492480
:param args: *Mapping[str,Any] - the modifications to apply.
493481
:param session: Optional[ClientSession]
494-
:return: [UpdateMany](https://roman-right.github.io/beanie/api/queries/#updatemany) query
482+
:return: [UpdateMany](query.md#updatemany) query
495483
"""
496484
return cast(
497485
UpdateMany,
@@ -510,10 +498,10 @@ def delete_many(
510498
**pymongo_kwargs,
511499
) -> DeleteMany:
512500
"""
513-
Provide search criteria to the [DeleteMany](https://roman-right.github.io/beanie/api/queries/#deletemany) query
501+
Provide search criteria to the [DeleteMany](query.md#deletemany) query
514502
515503
:param session:
516-
:return: [DeleteMany](https://roman-right.github.io/beanie/api/queries/#deletemany) query
504+
:return: [DeleteMany](query.md#deletemany) query
517505
"""
518506
# We need to cast here to tell mypy that we are sure about the type.
519507
# This is because delete may also return a DeleteOne type in general, and mypy can not be sure in this case
@@ -559,14 +547,14 @@ def aggregate(
559547
AggregationQuery[FindQueryProjectionType],
560548
]:
561549
"""
562-
Provide search criteria to the [AggregationQuery](https://roman-right.github.io/beanie/api/queries/#aggregationquery)
550+
Provide search criteria to the [AggregationQuery](query.md#aggregationquery)
563551
564552
:param aggregation_pipeline: list - aggregation pipeline. MongoDB doc:
565553
<https://docs.mongodb.com/manual/core/aggregation-pipeline/>
566554
:param projection_model: Type[BaseModel] - Projection Model
567555
:param session: Optional[ClientSession] - PyMongo session
568556
:param ignore_cache: bool
569-
:return:[AggregationQuery](https://roman-right.github.io/beanie/api/queries/#aggregationquery)
557+
:return:[AggregationQuery](query.md#aggregationquery)
570558
"""
571559
self.set_session(session=session)
572560
find_query = self.get_filter_query()
@@ -713,10 +701,6 @@ async def count(self) -> int:
713701
class FindOne(FindQuery[FindQueryResultType]):
714702
"""
715703
Find One query class
716-
717-
Inherited from:
718-
719-
- [FindQuery](https://roman-right.github.io/beanie/api/queries/#findquery)
720704
"""
721705

722706
UpdateQueryType = UpdateOne
@@ -882,12 +866,12 @@ def update_one(
882866
**pymongo_kwargs,
883867
) -> UpdateOne:
884868
"""
885-
Create [UpdateOne](https://roman-right.github.io/beanie/api/queries/#updateone) query using modifications and
869+
Create [UpdateOne](query.md#updateone) query using modifications and
886870
provide search criteria there
887871
:param args: *Mapping[str,Any] - the modifications to apply
888872
:param session: Optional[ClientSession] - PyMongo sessions
889873
:param response_type: Optional[UpdateResponse]
890-
:return: [UpdateOne](https://roman-right.github.io/beanie/api/queries/#updateone) query
874+
:return: [UpdateOne](query.md#updateone) query
891875
"""
892876
return cast(
893877
UpdateOne,
@@ -907,9 +891,9 @@ def delete_one(
907891
**pymongo_kwargs,
908892
) -> DeleteOne:
909893
"""
910-
Provide search criteria to the [DeleteOne](https://roman-right.github.io/beanie/api/queries/#deleteone) query
894+
Provide search criteria to the [DeleteOne](query.md#deleteone) query
911895
:param session: Optional[ClientSession] - PyMongo sessions
912-
:return: [DeleteOne](https://roman-right.github.io/beanie/api/queries/#deleteone) query
896+
:return: [DeleteOne](query.md#deleteone) query
913897
"""
914898
# We need to cast here to tell mypy that we are sure about the type.
915899
# This is because delete may also return a DeleteOne type in general, and mypy can not be sure in this case

beanie/odm/queries/update.py

-13
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ class UpdateResponse(str, Enum):
4444
class UpdateQuery(UpdateMethods, SessionMethods, CloneInterface):
4545
"""
4646
Update Query base class
47-
48-
Inherited from:
49-
50-
- [SessionMethods](https://roman-right.github.io/beanie/api/interfaces/#sessionmethods)
51-
- [UpdateMethods](https://roman-right.github.io/beanie/api/interfaces/#aggregatemethods)
5247
"""
5348

5449
def __init__(
@@ -109,10 +104,6 @@ async def _update(self) -> UpdateResult:
109104
class UpdateMany(UpdateQuery):
110105
"""
111106
Update Many query class
112-
113-
Inherited from:
114-
115-
- [UpdateQuery](https://roman-right.github.io/beanie/api/queries/#updatequery)
116107
"""
117108

118109
def update(
@@ -229,10 +220,6 @@ def __await__(
229220
class UpdateOne(UpdateQuery):
230221
"""
231222
Update One query class
232-
233-
Inherited from:
234-
235-
- [UpdateQuery](https://roman-right.github.io/beanie/api/queries/#updatequery)
236223
"""
237224

238225
def __init__(self, *args, **kwargs):

docs/tutorial/aggregate.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ avg_price = await Product.find(
1212
avg_price = await Product.avg(Product.price)
1313
```
1414

15-
A full list of available methods can be found [here](/api-documentation/interfaces/#aggregatemethods).
15+
A full list of available methods can be found [here](../api-documentation/interfaces.md/#aggregatemethods).
1616

1717
You can also use the native PyMongo syntax by calling the `aggregate` method.
1818
However, as Beanie will not know what output to expect, you will have to supply a projection model yourself.

docs/tutorial/defining-a-document.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ It uses all the same patterns of `BaseModel`. But also it has special types of f
4747

4848
`id` field of the `Document` class reflects the unique `_id` field of the MongoDB document.
4949
Each object of the `Document` type has this field.
50-
The default type of this is [PydanticObjectId](/api-documentation/fields/#pydanticobjectid).
50+
The default type of this is [PydanticObjectId](../api-documentation/fields.md/#pydanticobjectid).
5151

5252
```python
5353
class Sample(Document):

docs/tutorial/find.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ products = await Product.find(
5353
).to_list()
5454
```
5555

56-
The whole list of the find query operators can be found [here](/api-documentation/operators/find).
56+
The whole list of the find query operators can be found [here](../api-documentation/operators/find.md).
5757

5858
For more complex cases native PyMongo syntax is also supported:
5959

@@ -64,14 +64,14 @@ products = await Product.find({"price": 1000}).to_list()
6464
## Finding single documents
6565

6666
Sometimes you will only need to find a single document.
67-
If you are searching by `id`, then you can use the [get](/api-documentation/document/#documentget) method:
67+
If you are searching by `id`, then you can use the [get](../api-documentation/document.md/#documentget) method:
6868

6969
```python
7070
bar = await Product.get("608da169eb9e17281f0ab2ff")
7171
```
7272

7373
To find a single document via a single search criterion,
74-
you can use the [find_one](/api-documentation/interfaces/#findinterfacefind_one) method:
74+
you can use the [find_one](../api-documentation/interfaces.md/#findinterfacefind_one) method:
7575

7676
```python
7777
bar = await Product.find_one(Product.name == "Peanut Bar")
@@ -102,7 +102,7 @@ chocolates = await Product
102102

103103
### Sorting
104104

105-
Sorting can be done with the [sort](/api-documentation/query#sort) method.
105+
Sorting can be done with the [sort](../api-documentation/query.md/#findmanysort) method.
106106

107107
You can pass it one or multiple fields to sort by. You may optionally specify a `+` or `-`
108108
(denoting ascending and descending respectively).

docs/tutorial/update.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ More complex update operations can be performed by calling `update()` with an up
4949
await Product.find_one(Product.name == "Tony's").update(Set({Product.price: 3.33}))
5050
```
5151

52-
The whole list of the update query operators can be found [here](/api-documentation/operators/update).
52+
The whole list of the update query operators can be found [here](../api-documentation/operators/update.md).
5353

5454
Native MongoDB syntax is also supported:
5555

pydoc-markdown.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ renderer:
1616
output_directory: docs/build
1717
mkdocs_config:
1818
site_name: Beanie Documentation
19-
site_url: https://roman-right.github.io/beanie/
19+
site_url: https://beanie-odm.dev/
2020
theme:
2121
name: material
2222
palette:

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ doc = [
5151
queue = ["beanie-batteries-queue>=0.2"]
5252

5353
[project.urls]
54-
homepage = "https://roman-right.github.io/beanie/"
54+
homepage = "https://beanie-odm.dev"
5555
repository = "https://github.com/roman-right/beanie"
5656

5757
[project.scripts]
@@ -144,4 +144,4 @@ target-version = "py310"
144144

145145
[tool.ruff.mccabe]
146146
# Unlike Flake8, default to a complexity level of 10.
147-
max-complexity = 10
147+
max-complexity = 10

0 commit comments

Comments
 (0)