Core App Endpoints
/
Render the home page.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
HttpRequest
|
An HTTP request object. |
required |
Returns:
Name | Type | Description |
---|---|---|
HttpResponse |
HttpResponse
|
The rendered HTML home page, redirect to |
Source code in apps\core\views.py
18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
/search?query='{query}'
Handle search requests. Includes options for: search on keyword search on topic search for keywords on a specified topic
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
HttpRequest
|
An HTTP request object containing GET parameters:
|
required |
Returns:
Name | Type | Description |
---|---|---|
HttpResponse |
HttpResponse
|
The rendered search results page listing all bills matching a search query. |
Results |
HttpResponse
|
An array of JSON objects from the Postgres database, containing bill information about searched bills. The fields correspond to the columns in the database's bills table:
|
Example:
http://billinois.unnamed.computer/search/?query=environment
[
{
"bill_id": '123',
"number": "HB-001",
"title": "Test Bill",
"summary": "Tests a bill.",
"status": "Submitted",
"topics": ['Environment', 'Education'],
"sponsors": ['Rep. Patel', 'Rep. Wilks']
},
...
]
Source code in apps\core\views.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
/bill/{bill_number}
Return detailed bill data. At least one of the following must be provided:
bill_id
, or- All of:
state
,session
, andbill_number
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
HttpRequest
|
An HTTP request object. |
required |
bill_id
|
str
|
The unique identifier for the bill. |
None
|
state
|
str
|
The name of the U.S. state where the bill was introduced. |
None
|
session
|
str
|
The legislative session. |
None
|
bill_number
|
str
|
The assigned bill number. |
None
|
Returns:
Name | Type | Description |
---|---|---|
HttpResponse |
HttpResponse
|
A Django context variable with the data from the query. |
Results |
HttpResponse
|
Contains the following columns from database's table:
|
Example:
http://billinois.unnamed.computer/bill/illinois/104th/hb3657/
http://billinois.unnamed.computer/bill/ocd-bill/12bcc69d-cfa4-4021-974a-5f562297ea34
[
{
"bill_id": '123',
"number": "HB-001",
"title": "Test Bill",
"summary": "Tests a bill.",
"status": "Submitted",
"topics": ['Environment', 'Education'],
"sponsors": ['Rep. Patel', 'Rep. Wilks']
},
...
]
Source code in apps\core\views.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
|
/favorites/
Return a list of bills favorited by the current user, with optional sorting.
If "?sort=action_date" GET parameter is provided the favorited bills will be sorted
by the most recent relevant (has a non-null category
) action taken on each bill.
Otherwise, the list is sorted by favorite_id
(order in which user favorited each bill).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
HttpRequest
|
The HTTP request object containing user-optional GET parameters:
|
required |
Returns:
Name | Type | Description |
---|---|---|
HttpResponse |
A Django context variable with the data from the query. If the user is not logged in, redirect to the
|
Example:
http://billinois.unnamed.computer/favorites/?sort=action_date
[
{
"bill_id": "123",
"number": "HB-001",
"title": "Test Bill",
"summary": "Tests a bill.",
"status": "Submitted",
"topics": ["Environment", "Education"],
"sponsors": ["Rep. Patel", "Rep. Wilks"]
},
...
]
Source code in apps\core\views.py
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
|
/privacy_policy/
Render the privacy policy page.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
HttpRequest
|
An HTTP request object. |
required |
Returns: HttpResponse: The rendered HTML privacy policy page.
Source code in apps\core\views.py
376 377 378 379 380 381 382 383 384 385 |
|