jfinkels / flask-restless

NO LONGER MAINTAINED - A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.
https://flask-restless.readthedocs.io
GNU Affero General Public License v3.0
1.02k stars 301 forks source link

Collection name mangling #667

Open mixmastamyk opened 7 years ago

mixmastamyk commented 7 years ago

Hi, had a model with a compound name similar to "FirstLast". Under the admin it is given an url like "firstlast", but under flask-restless it gets turned into "first_last."

I'm fine with either but believe the admin's version is more common. Might the underscores be removed?

green3g commented 7 years ago

You can specify a collection_name when you call create_api.

https://github.com/jfinkels/flask-restless/blob/master/flask_restless/manager.py#L446

mixmastamyk commented 7 years ago

Hi thanks, I've done that, and will have to do it for every model with a compound name.

Seems it would be easier for the admin and flask-restless to match. ;-)