You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contributing/dev_environment.md
+5
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ Set up two-factor authentication on your account by following this [guide](https
19
19
Before cloning your forked repository to your local machine, you must have Git installed. You can find instructions for installing Git for your operating system [**here**](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
20
20
21
21
=== "Windows"
22
+
22
23
- we recommend [installing Windows Subsystem for Linux (WSL)](https://code.visualstudio.com/docs/remote/wsl). WSL provides a Linux-compatible environment that can prevent common errors during script execution.
23
24
24
25
- After setting up WSL, install Git directly from the Linux terminal. This method can help avoid complications that sometimes arise when using Git Bash on Windows.
@@ -32,6 +33,7 @@ Before cloning your forked repository to your local machine, you must have Git i
32
33
!!! tip "Feel free to reach out in the [Hack for LA Slack channel](https://hackforla.slack.com/messages/people-depot/) if you encounter any errors while running scripts on Windows"
33
34
34
35
=== "Mac"
36
+
35
37
Please note that if you have a Mac the page offers several options (see other option, if you need to conserve hard drive space) including:
36
38
37
39
- an “easiest” option (this version is fine for our use): This option would take just over 4GB.
@@ -61,6 +63,7 @@ You can fork the hackforla/peopledepot repository by clicking <a href="https://g
61
63
. A fork is a copy of the repository that will be placed on your GitHub account.
62
64
63
65
!!! note "It should create a URL that looks like the following -> `https://github.com/<your_GitHub_user_name>/peopledepot`"
66
+
64
67
!!! example "For example -> `https://github.com/octocat/peopledepot`"
65
68
66
69
!!! info "What you have created is a forked copy in a remote version on GitHub. It is not on your local machine yet"
It will show `Active: active (running)`if it's running.
140
144
141
145
=== "Docker Desktop"
146
+
142
147
1. Start Docker Desktop
143
148
1. Run `docker container ls` to verify Docker Desktop is running. If it is not running you will get the message: `Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?`
Copy file name to clipboardExpand all lines: docs/contributing/howto/add-model-and-api-endpoints.md
+13
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
This guide aims to enable developers with little or no django experience to add django models and API endpoints to the project. Most code examples are followed by detailed explanations.
4
4
5
5
??? note "The developer will have exposure to the following in this document"
6
+
6
7
- python
7
8
- django
8
9
- django rest framework
@@ -22,6 +23,7 @@ Let's start!
22
23
## Data model
23
24
24
25
??? note "TDD test"
26
+
25
27
1. Write the test
26
28
27
29
We would like the model to store these data, and to return the name property in the str function.
@@ -117,6 +119,7 @@ class RecurringEvent(AbstractBaseModel): # (1)!
117
119
1. Always override the `__str__` function to output something more meaningful than the default. It lets us do a quick test of the model by calling `str([model])`. It's also useful for the admin site model list view.
118
120
119
121
??? note "Updating models.py for many-to-many relationships"
122
+
120
123
For adding many-to-many relationships with additional fields, such as `ended_on`, we can add
121
124
122
125
```python title="app/core/models.py" linenums="1"
@@ -165,6 +168,7 @@ This generates the database migration files
165
168
```
166
169
167
170
??? note "Test"
171
+
168
172
Since we overrode the `__str__` function, we need to write a test for it.
169
173
170
174
1. Add a fixture for the model
@@ -212,6 +216,7 @@ This generates the database migration files
212
216
```
213
217
214
218
??? note "Check and commit"
219
+
215
220
This is a good place to pause, check, and commit progress.
216
221
217
222
1. Run pre-commit checks
@@ -274,11 +279,13 @@ Check that everything's working and there are no issues, which should be the cas
274
279
1. Having a misconfigured or buggy custom field could cause the admin site to crash and the developer will need to look at the debug message and resolve it.
275
280
276
281
??? note "Test"
282
+
277
283
1. Feel free to write tests for the admin. There's no example for it yet.
278
284
1. The reason there's no tests is that the admin site is independent of the API functionality, and we're mainly interested in the API part.
279
285
1. When the time comes that we depend on the admin interface, we will need to have tests for the needed functionalities.
280
286
281
287
??? note "Check and commit"
288
+
282
289
This is a good place to pause, check, and commit progress.
283
290
284
291
1. Run pre-commit checks
@@ -305,6 +312,7 @@ This is code that serializes objects into strings for the API endpoints, and des
305
312
In `app/core/api/serializers.py`
306
313
307
314
??? note "Updating serializers.py for many-to-many relationships"
315
+
308
316
Following the many-to-many relationship between project and recurring event from above,
309
317
310
318
Update the existing serializer classes
@@ -458,6 +466,7 @@ In `app/core/api/views.py`
458
466
1. It doesn't control permissions the way we want, but we will fix it later.
459
467
460
468
??? note "Extended example: Query Params"
469
+
461
470
This example shows how to add a filter params. It's done for the [user model](https://github.com/hackforla/peopledepot/issues/15) as a [requirement](https://github.com/hackforla/peopledepot/issues/10) from VRMS.
462
471
463
472
1. Here's a more complex API doc example (this example is using the User model's ViewSet)
@@ -565,6 +574,7 @@ In `app/core/api/urls.py`
565
574
-`reverse("recurring-event-list")` would return`http://localhost:8000/api/v1/recuring-events/`
566
575
567
576
??? note "Test"
577
+
568
578
For the CRUD operations, since we're using `ModelViewSet` where all the actions are provided by `rest_framework` and well-tested, it's not necessary to have test cases for them. But here's an example of one.
569
579
570
580
In `app/core/tests/test_api.py`
@@ -610,6 +620,7 @@ In `app/core/api/urls.py`
610
620
```
611
621
612
622
??? note "Test many-to-many relationships"
623
+
613
624
In `app/core/tests/test_api.py`
614
625
615
626
1. Import APIURL
@@ -649,6 +660,7 @@ In `app/core/api/urls.py`
649
660
```
650
661
651
662
??? note "Check and commit"
663
+
652
664
This is a good place to pause, check, and commit progress.
653
665
654
666
1. Run pre-commit checks
@@ -665,4 +677,5 @@ In `app/core/api/urls.py`
665
677
```
666
678
667
679
??? note "Push the code and start a PR"
680
+
668
681
Refer to the [Issues page section on "Push to upstream origin"](issues.md#push-to-upstream-origin-aka-your-fork) onward.
Copy file name to clipboardExpand all lines: docs/contributing/team.md
+1
Original file line number
Diff line number
Diff line change
@@ -5,4 +5,5 @@ This step is optional if this is your first time fixing an issue and you want to
5
5
In the [People-depot Slack channel](https://hackforla.slack.com/messages/people-depot/), send an introductory message with your GitHub `handle/username` asking to be added to the Hack for LA peopledepot GitHub repository, have access to the Google Docs Drive, and Figma.
6
6
7
7
!!! note "Please do the following once you have accepted the GitHub invite (comes via email or in your GitHub notifications)"
8
+
8
9
Make your own Hack for LA GitHub organization membership public by following this [guide](https://help.github.com/en/articles/publicizing-or-hiding-organization-membership#changing-the-visibility-of-your-organization-membership).
0 commit comments