From fbd2b76e0d1eaa433da293252b8444379d66c3af Mon Sep 17 00:00:00 2001 From: Dominic DiTaranto Date: Sat, 13 Jun 2026 21:58:57 -0400 Subject: [PATCH] add gitignore --- .gitignore | 217 ++++++++++++++++++++ api/views/__pycache__/event.cpython-314.pyc | Bin 0 -> 4058 bytes api/views/event.py | 61 ++++++ db.sqlite3 | Bin 172032 -> 172032 bytes 4 files changed, 278 insertions(+) create mode 100644 .gitignore create mode 100644 api/views/__pycache__/event.cpython-314.pyc create mode 100644 api/views/event.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8263906 --- /dev/null +++ b/.gitignore @@ -0,0 +1,217 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[codz] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py.cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +# Pipfile.lock + +# UV +# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# uv.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +# poetry.lock +# poetry.toml + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python. +# https://pdm-project.org/en/latest/usage/project/#working-with-version-control +# pdm.lock +# pdm.toml +.pdm-python +.pdm-build/ + +# pixi +# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control. +# pixi.lock +# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one +# in the .venv directory. It is recommended not to include this directory in version control. +.pixi + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# Redis +*.rdb +*.aof +*.pid + +# RabbitMQ +mnesia/ +rabbitmq/ +rabbitmq-data/ + +# ActiveMQ +activemq-data/ + +# SageMath parsed files +*.sage.py + +# Environments +.env +.envrc +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +# .idea/ + +# Abstra +# Abstra is an AI-powered process automation framework. +# Ignore directories containing user credentials, local state, and settings. +# Learn more at https://abstra.io/docs +.abstra/ + +# Visual Studio Code +# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore +# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore +# and can be added to the global gitignore or merged into this file. However, if you prefer, +# you could uncomment the following to ignore the entire vscode folder +# .vscode/ + +# Ruff stuff: +.ruff_cache/ + +# PyPI configuration file +.pypirc + +# Marimo +marimo/_static/ +marimo/_lsp/ +__marimo__/ + +# Streamlit +.streamlit/secrets.toml +config* diff --git a/api/views/__pycache__/event.cpython-314.pyc b/api/views/__pycache__/event.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..efddd7b41e9907e8b14eaf380370f0adabe326bd GIT binary patch literal 4058 zcmbtX-ESMm5nuA|$RkCH)CWaUACVMUiX_`)95At)wn5@T1_?B-aA^n?uydfub94%I zWcH4B+U7xTRe+$WkOxV55d##6^kny`ul*AuTu>bj7Eqvl>6>c>Z67W_I@KU^GmCu7oq2{}2iJD|Q?b+KuxyXl#@Bh~z7fywC7WW7}Ww=Q)F8 zZLYxQ1w&wMz7WU0o}+-&#iT#>9gmUSlJ94^;h2_N$v`)q&x zgC&jzKtyr69h27^YPBL$$27dn>q_;39i+;K4aLxHQ9(<|YQ+{P39)&2Ke zs}}v2Sx6#|g?h++edPW=a`yy!;PZXf3w`8)KJs86x!6Y@>LU;LkqDRMK?Iv(&= zZZ+sRD(L3gL(>Gj89l>87rZ%Y^IB<3u?H%OUZ!f@P-~jaHE7iimMRtSXWb6yM#*UC zwos>PS+OJN(kfMCsz0pTVGvS7HdMe66|K^0g=k6De>YSoU^H)@(9YmKdS zg)T*C5;jFs$kNEhkxd|*L^g%&1!U;dbOzZhvKN6Z2{ym_vv+>ZLXVEX2n1W{p+ci5 z5c;2hZ4)at_Swgue7wUyjVG+3 z#9nGQwZC8v&049+L-9atPMN8!6(8Lbcg6k0=P_$EwU^(`@BhLaeaRY0?%mqGwVyXf z=B?qey~W+d{hQ|SoRywBOdX_}88dyuN>1#3wEIyrVkWO!iS*vu?%MvQnOL&M#`iXM zH}-#Rj$Q4w_S~fe-=&3~?ZG{%9tdGTz{KF8E(8o$Mm-P)009$T)lCjP=W3Y%+PPMQp3%!f9tMT+L`b{Q~7H1OUQ>ec7#vE z*5u4#{vhAH|77Jfw{ntOF(>cr2;YclC+WW1T=}Z-Wx*WH!1R!lq0>hzkKaCi+f2O< zqfsZ}ibwO0uN_}AlQ&^B;-uS0N5bQQ;{kIl2crYl)a>Ef!CF&$qMW{#KY1;0P8INj zV!Qtd*{<}|k&ygULr{ww*x zJ2~c^ckaSH+bMqorLv*I1&mJ8zJR;@qwDTnXnRJWqEr5%a(=pyWg=}(? z9ahT{zm2qXcXtl+u|9>LcrLNUol3vxR-WBetfLjwQ2tdOmU!r*U9jrE3#w!4r#PGW zyrU`lza3}gxvaa79b0rB0~hNK7DRTsqqyhk@B={85fUsgv3!&>Ctm(qOg$Z$`26)9 z(Mm0zrmml)uJ4H8(6QuBj9KEC++7;5MOnsDPL}PkEN|5+jViVyvixDARBcOQviv}$ zx=~d%MXSkjD>1x;DlH?+Aj2@X6S9nTpIVknhC$W!hN0*HHzdpDYDw2CYS}0&)v7GR zLoeDj2+JV6$(yXmqIgj;hIgKhN$KCe0nMKK{leAf;t;TfVd2X2MNUZkE6fY2X9O72 ziLFAlM!}AT{D6XLk81RT40{bxJa0Sc5jhrTXJp48DeD=qgHqKq>~vahwRmN-q`hCu z=o>X^lpBW59NA95ODoekK4%F#a;62kOlxPXd=!7wGVvSqEfAo}`V6pVoX_VwBa3I` a+8KHAjAYKpjc)_5`cl6O{*%BTL--E{dCqkJ literal 0 HcmV?d00001 diff --git a/api/views/event.py b/api/views/event.py new file mode 100644 index 0000000..d32a82e --- /dev/null +++ b/api/views/event.py @@ -0,0 +1,61 @@ +from rest_framework.views import APIView +from rest_framework.response import Response +from web.models.event import Event +from django.shortcuts import get_object_or_404 +from api.serializers.event import EventSerializer + + +class EventView(APIView): + def get(self, requets, event_id): + event = get_object_or_404(Event, pk=event_id) + return self._build_response(event) + + def post(self, request): + data = request.POST + event = Event( + name=data.get('name'), + description=data.get('description'), + url=data.get('url'), + address=data.get('address'), + status=data.get('status'), + price=data.get('price'), + require_rsvp=data.get('require_rsvp'), + start_time=data.get('start_time'), + end_time=data.get('end_time'), + rain_date=data.get('rain_date'), + email=data.get('email'), + phone_number=data.get('phone_number'), + ) + event.save() + return self._build_response(event) + + def put(self, request, event_id): + data = request.POST + + event = get_object_or_404(Event, pk=event_id) + event.name = data.get('name', event.name) + event.description = data.get('description', event.description) + event.url = data.get('url', event.url) + event.address = data.get('address', event.address) + event.status = data.get('status', event.status) + event.price = data.get('price', event.price) + event.require_rsvp = data.get('require_rsvp', event.require_rsvp) + event.start_time = data.get('start_time', event.start_time) + event.end_time = data.get('end_time', event.end_time) + event.rain_date = data.get('rain_date', event.rain_date) + event.email = data.get('email', event.email) + event.phone_number = data.get('phone_number', event.phone_number) + + event.save() + self._build_response(event) + + def delete(self, request, event_id): + event = get_object_or_404(Event, pk=event_id) + event.active = False + event.save() + + def _build_response(self, data): + event_serializer = EventSerializer(data) + response = Response() + response.data = event_serializer.data + return response diff --git a/db.sqlite3 b/db.sqlite3 index 7564bc844b31328feac81d5367ba89f745d20214..bb1a8adf1ceae7631a3e50823edc5b7046a02741 100644 GIT binary patch delta 699 zcmZoTz}0YoYl1YR=0q81M$L^0OXP*v`O6siU-Dn!-_2jf-_1XZfBnYB1pdio`lbTx z3=9lh+{}`Usb#5oCB;mWck9bCayH-8-+oh{QM-VRk^eUX|L@I$4e$8{85mfY896z) zfLa*&|1j|X0SkjnU}omz+;)JGMF6ON7X$yU&4L9R_}yF>IT`qMIkg!%9SvPU#w+9} zWu+#UC}Zv$4^Duf8#kNsz(OkyBOE(q5jC!`RqZofp*rQ*$dr3q5lq69WTt zTr$RHA*sbB3J{kWm1JZVD*#cVLJ3ebqokyu*h*i&yu4g5B|kSMvqUdBKiAk$!7V2> zwZ5c0KR-pmrAWaeu_`CEM8PksI5{IVr8Flsg$va-V-qW5ONfvK%x^#;3%Dv%uy;+Y zOpJ0<9S}A(CNP41sEN&o^(bLvY-VHvHx4WV^t^$ko`JEUfstuSW=cw>LRwL3Vs?I7 f8VR1n<41QYd2-PPg-r)o1U9og_#?lpfXM&=x4yd~ delta 121 zcmZoTz}0YoYl1YR+C&*=MzxIzOXP*v_{$jhU-Dn!-_2jf-_1XZzhYx!0{`SPeNzEp z22?P4x4tYRNApen?KkxqwF@@0JoqC&X#&e~mII6ei&-8hENA(^sIZx3!yoxY2Lv`9 NU=aYTSXRJf004NqCddE)