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

Bug: Edit and View buttons in rows have 'undefined' hrefs in version 0.13 (up) but not in version 0.11 #545

Closed
samearcher opened this issue May 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@samearcher
Copy link

Describe the bug
I'm managing a materials database using Starlette-Admin. This has been working in version 0.11, but I've upgraded to 0.13 to make use of column_property.
This works ok except the edit and view buttons on each row have undefined hrefs so the links produce error 404.
This is the HTML served up under 0.13:

image

Under 0.11:

image

The model:

class A1_A3_Data_Base(BaseModel):
    
    material_class: Optional[str] = Field(default='STRUCTURE')
    mat_class_id: Optional[int] = Field(default=None, foreign_key="material_class.id")
    sheet_title: Optional[str] = Field(default='')
    table_heading: Optional[str] = Field(default='')
    table_subheading: Optional[str] = Field(default='')
    product_code: Optional[str] = Field(default='')
    material: Optional[str] = Field(default='')
    qty_basis: Optional[str]
    a1_a3_CO2: Optional[float]
    a1_a3_energy_total: Optional[float] 
    a1_a3_energy_non_renewable: Optional[float]
    a1_a3_energy_renewable: Optional[float] = Field(default=0)
    notes: Optional[str] = Field(default='')
    data_quality: Optional[Data_quality] = Field(default=Data_quality.A)
    density: Optional[float]
    area_density: Optional[float]
    linear_density: Optional[float]
    mass_per_unit: Optional[float]
    length: Optional[float]        


class A1_A3_Data_Create(A1_A3_Data_Base):
    pass

class A1_A3_Data(A1_A3_Data_Base, SQLModel, ActiveRecordMixin, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    mat_class: Material_Class = Relationship(back_populates="a1_a3_data")

    async def __admin_repr__(self, request: Request):
        return f"{self.table_heading, self.table_subheading}"

To Reproduce
Explain how to reproduce the bug.

Environment (please complete the following information):

  • Starlette-Admin version: [e.g. 0.11 and 0.13]
  • ORM/ODMs: [SQLAlchemy]
  • Database model: [SQLModel]

Additional context
Add any other context about the problem here.

@samearcher samearcher added the bug Something isn't working label May 17, 2024
@jowilf
Copy link
Owner

jowilf commented May 17, 2024

Try deleting your browser cache.

@samearcher
Copy link
Author

Thanks @jowilf , yes that worked. Thanks!

@jowilf jowilf closed this as completed May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants