Comments (6)
sounds like an interesting idea. just a couple of thoughts:
- I don't want to go overboard littering the request object with new attributes. Maybe there's a cleaner way of implementing what's there.
- Your fork removes the ability to force the mobile view using a cookie. I don't want to lose that.
- Would likely want to create new decorators or extend the functionality of the current decorators to accommodate some of the new features.
also feel free to submit a pull request so that it's easier to compare the changes.
from flask-mobility.
Thanks for the fast reply!
I should have been clearer about the removal of the cookies code (and the lack of a PR) - I did it to simplify the proof-of-concept (which I have running locally).
I am more than happy to submit a proper, cleanly edited PR with additional decorators if you are interested.
My main question is: are you happy to have a dependency on user-agent
? Or should it be optional somehow?
Re the new attributes on the request
object: I considered introducing a second level of access, e.g. request.MOBILITY.TABLET
or request.MOBILITY.is_mobile
but this would not be backwards-compatible with existing deployments using request.MOBILE
.
Is that an issue? A compromise would be to introduce something like request.MOBILITY
but retain request.MOBILE
(which would be aliased to e.g. request.MOBILITY.is_mobile
).
from flask-mobility.
Sorry about the delay getting back to you.
I'm fine with making user-agent
a dependency. It would be nice to have it be optional, but that's not a deal breaker for me.
I would like to ensure this stays backwards compatible so I like the idea of having request.MOBILE
and request.MOBILITY
.
Thanks!
from flask-mobility.
Thanks for the thumbs up. I will aim to pull something when I next make a related change in the client webapp, so can't be sure of a timeline just yet.
I will try to make user-agent
optional as a secondary goal.
from flask-mobility.
I thought about make the same thing using the user-agent
lib.
It's really an interesting idea.
What about the PR @wodow? Are you still think to integrate it?
Let me know if you are needing some help.
from flask-mobility.
@helielson i might get around to adding this in the next few weeks
from flask-mobility.
Related Issues (12)
- Create test suite HOT 1
- @mobilized doesn't work HOT 7
- Not compatible with Flask 3.0.0 and later. HOT 2
- Error: While importing "app", an ImportError was raised: HOT 2
- Error generated. HOT 3
- Meet requirements for Flask approved extensions HOT 7
- flask.request.MOBILE might be regex match instead of bool HOT 1
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- Remove .travis.yml file HOT 3
- Use flask-small theme for docs HOT 1
- Website not updated with `from flask_mobility` import HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-mobility.