Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marianacss #13

Open
wants to merge 29 commits into
base: Development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bd6c25e
pruebas
mdesarrollo24 Dec 3, 2024
342c854
pruebas
mdesarrollo24 Dec 6, 2024
b5517c0
pruebas 2
mdesarrollo24 Dec 6, 2024
b07db46
integracion con Development
mdesarrollo24 Dec 6, 2024
167c6f9
primer commit
mdesarrollo24 Dec 6, 2024
725b4ba
segundo commit
mdesarrollo24 Dec 6, 2024
1ea414a
tercer commit
mdesarrollo24 Dec 6, 2024
ded0fe6
commit con funcionalidad
mdesarrollo24 Dec 6, 2024
1b21dbf
commit con funcionalidades
mdesarrollo24 Dec 6, 2024
cb9732c
prueba petviews
mdesarrollo24 Dec 7, 2024
883ceb1
prueba vistas
mdesarrollo24 Dec 7, 2024
1a04e3a
Petcard in progress
mdesarrollo24 Dec 7, 2024
cd35d56
prueba
mdesarrollo24 Dec 9, 2024
8e5bd77
guardado
mdesarrollo24 Dec 9, 2024
a62c2ac
cards en proceso 2
mdesarrollo24 Dec 9, 2024
39b19fb
cards in process
mdesarrollo24 Dec 9, 2024
60494c1
Se conectó el backend con el front para la vista de update password
mdesarrollo24 Dec 12, 2024
3d48797
card individual
mdesarrollo24 Dec 12, 2024
028f55b
[Prueba de conexion entre PetView y datos de API]
MatiRosas31 Dec 12, 2024
308adff
Merge pull request #14 from 4GeeksAcademy/conectandoBackendDemarianacss
MatiRosas31 Dec 12, 2024
be85710
cards
mdesarrollo24 Dec 12, 2024
f441132
cards en proceso
mdesarrollo24 Dec 12, 2024
4ee71ad
integracion con Development
mdesarrollo24 Dec 12, 2024
35e7199
ok
mdesarrollo24 Dec 12, 2024
9370ea0
cards faltando detalles
mdesarrollo24 Dec 12, 2024
76fc4a3
cardsin progress
mdesarrollo24 Dec 13, 2024
386026a
cards para corregir
mdesarrollo24 Dec 13, 2024
1cdc2cc
Merge branch 'Development' into marianacss
mdesarrollo24 Dec 13, 2024
504eab8
Added PetCard.jsx
MatiRosas31 Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[javascriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
}
}
1 change: 0 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
"""empty message

Revision ID: 5cf725964086
Revises: e882aaa7e01e
Create Date: 2024-11-30 11:31:26.832067
Revision ID: cb544095a50b
Revises: d6e7917535b2
Create Date: 2024-12-11 22:58:32.170013

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5cf725964086'
down_revision = 'e882aaa7e01e'
revision = 'cb544095a50b'
down_revision = 'd6e7917535b2'
branch_labels = None
depends_on = None

Expand All @@ -21,7 +21,7 @@ def upgrade():
op.create_table('breed',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=30), nullable=True),
sa.Column('species', sa.Enum('perro', 'gato', 'ave', 'conejo', 'otro', name='species'), nullable=False),
sa.Column('species', sa.Enum('perro', 'gato', 'ave', 'conejo', 'reptil', 'otro', name='species'), nullable=False),
sa.PrimaryKeyConstraint('id')
)
op.create_table('pet',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""empty message

Revision ID: 65ec0a935ab9
Revision ID: d6e7917535b2
Revises:
Create Date: 2024-11-27 23:26:32.249259
Create Date: 2024-12-03 00:34:48.862682

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '65ec0a935ab9'
revision = 'd6e7917535b2'
down_revision = None
branch_labels = None
depends_on = None
Expand Down
35 changes: 0 additions & 35 deletions migrations/versions/e882aaa7e01e_.py

This file was deleted.

5 changes: 4 additions & 1 deletion src/api/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import os
from flask_admin import Admin
from .models import db, User
from .models import db, User, Pet, Post_Description, Breed
from flask_admin.contrib.sqla import ModelView

def setup_admin(app):
Expand All @@ -12,6 +12,9 @@ def setup_admin(app):

# Add your models here, for example this is how we add a the User model to the admin
admin.add_view(ModelView(User, db.session))
admin.add_view(ModelView(Pet, db.session))
admin.add_view(ModelView(Post_Description, db.session))
admin.add_view(ModelView(Breed, db.session))

# You can duplicate that line to add mew models
# admin.add_view(ModelView(YourModelName, db.session))
7 changes: 3 additions & 4 deletions src/api/models.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Examinar si estan bien los cambios

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Pet(db.Model):
__tablename__ ="pet"
id = db.Column (db.Integer, primary_key=True)
name = db.Column (db.String(30))
breed = db.Column (db.Integer, db.ForeignKey("breed.id"))
breed = db.Column (db.Integer, db.ForeignKey("breed.id")) # bread_id
gender = db.Column (db.Enum(Genders))
color = db.Column (db.String(15))
photo_1 = db.Column (db.String(120), nullable=False)
Expand All @@ -58,15 +58,14 @@ class Pet(db.Model):
user_id = db.Column (db.Integer, db.ForeignKey("user.id"))
user = db.relationship ("User", back_populates="pet")
post = db.relationship("Post_Description", back_populates="pet_relationship")
breed_relationship = db.relationship("Breed", back_populates= "pets")
breed_relationship = db.relationship("Breed", back_populates= "pets") # breed

def __repr__(self):
return f'<Pet {self.name, self.species, self.color, self.user}>'
return f'<Pet {self.name, self.color, self.user}>'

def serialize(self):
return{
"name" : self.name,
"species" : self.species,
"breed" : self.breed,
"color": self.color,
"photo_1": self.photo_1,
Expand Down
9 changes: 9 additions & 0 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ def create_post_description():
return jsonify({'msg':'Post creado exitosamente', 'data': new_post.serialize()}), 201
#######

#GET All pets Matias 17:46PM 3/12/24..Update: working 11:43AM 4/12/24
@app.route('/pets', methods=['GET'])
def get_all_pets():
pets = Pet.query.all()
pets_serialized = []
for pet in pets:
pets_serialized.append(pet.serialize())
return jsonify({'msg': 'ok', 'data': pets_serialized}), 200


# any other endpoint will try to serve it like a static file
@app.route('/<path:path>', methods=['GET'])
Expand Down
18 changes: 18 additions & 0 deletions src/front/js/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import { PasswordResetProvider } from "./PasswordResetContext"; // Importamos el proveedor
import ResetPassword from "./ResetPassword"; // Importamos el componente de recuperación de contraseña
import PetsView from "./PetsView"; // Vista de mascotas

function App() {
return (
<PasswordResetProvider>
<div className="App">
<h1>Aplicación de Recuperación de Contraseña y Mascotas</h1>
<ResetPassword /> {/* Componente de recuperación de contraseña */}
<PetsView /> {/* Componente de vista de mascotas */}
</div>
</PasswordResetProvider>
);
}

export default App;
46 changes: 46 additions & 0 deletions src/front/js/component/Filters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from "react";
import "../../styles/pets-view.css";

const Filters = ({ onFilterChange }) => {
return (
<div className="filters">
<h4>Filter</h4>
<div>
<label>
<input type="radio" name="gender" value="male" onChange={onFilterChange} />
Male
</label>
<label>
<input type="radio" name="gender" value="female" onChange={onFilterChange} />
Female
</label>
</div>
<div>
<label>
<input type="checkbox" name="color" value="black" onChange={onFilterChange} />
Black
</label>
<label>
<input type="checkbox" name="color" value="white" onChange={onFilterChange} />
White
</label>
<label>
<input type="checkbox" name="color" value="brown" onChange={onFilterChange} />
Brown
</label>
</div>
<div>
<label>
<input type="radio" name="size" value="small" onChange={onFilterChange} />
Small
</label>
<label>
<input type="radio" name="size" value="large" onChange={onFilterChange} />
Large
</label>
</div>
</div>
);
};

export default Filters;
Loading