Comments (6)
Crispy has been talked about before, and it explicitly calls out Bootstrap 3 in the readme. I would vote for trying crispy.
from nyc-trees.
I suspect (and Steve's experience seems to show) that {{ form.as_p }}
and friends are too brittle and you need to unroll field refs in your templates. Django forms give you plenty beyond that.
Do you know whether any of the alternatives address your other issues?
Looks like a big part of Crispy Forms is doing layout in the Python code. While that might be somewhat more concise I'd rather stick with HTML templates to facilitate working with the design team.
from nyc-trees.
I'd be most inclined to give floppy forms a shot if we're going to stick with doing all of our layouts in templates, it looks like they tackle some of the client-side HTML5 validation I mentioned (see http://django-floppyforms.readthedocs.org/en/latest/differences.html).
It looks like the main benefits of Crispy are more powerful control of layout in Python, but I don't see anything in the docs about using HTML5 input attributes.
from nyc-trees.
My experience has been that {{ form.as_<...> }}
breaks down in all cases beyond simple prototyping. I am skeptical that generated markup provided by another library would yield different results.
The next step further in granularity is to break the form down further:
https://github.com/vegphilly/vegphilly.com/blob/master/vegancity/templates/vegancity/new_vendor.html
Which renders to stuff like
<div class="fieldWrapper">
<label for="id_name">Name
</label>
<input id="id_name" maxlength="255" name="name" type="text">
</div>
This is not a huge improvement, because there is still a fair amount of markup generation. DOM id
and class
attributes are still created by django, and you end up with different sets of naming conventions in your CSS, (some for attributes you write yourself, different for the generated ones).
This, as I see it, is the core problem:
- missing HTML5 attributes
- non-semantic dom attributes
- Weird Spacing
I don't know if this can be done better with vanilla django forms, and I obviously don't know if it's any different in these 3rd-party libs.
I think they all support a concept of widgets, which allows you to customize how markup is generated. My inkling is that this would be painful. I don't love writing new classes for a problem that can be solved declaratively in HTML.
from nyc-trees.
In conclusion, my vote is that we stick with django forms and write our own markup. That said, I think whichever of the 3 discussed solutions (vanilla, floppy, crispy) will be fine. The only risk is bringing in a library that doesn't get you much.
from nyc-trees.
We went with floppyforms
from nyc-trees.
Related Issues (20)
- When you are logged out, the progress map does not show block edge tiles
- Deprecation warnings when using Ansible 2.0
- Create new failover site distribution after next deployment
- Allow a survey to be restarted from the preview map HOT 3
- Zoom the survey preview to the extent of the blockface and limit panning and zooming
- Implement final text changes HOT 4
- Respond to testing feedback HOT 1
- Preview screen layout incorrect on tablet HOT 9
- Crosshairs on Treecorder block selection misaligned HOT 5
- Tiles not loading when visit block preview for a second time
- Tree tab arrows stack after previewing a block HOT 5
- Side menu z-index is below the treecorder content
- Map on Reservations page only fills half of screen HOT 4
- ProgrammingError: could not determine polymorphic type because input has type "unknown" HOT 1
- Blockedges are not being set to unavailable after submitting a survey HOT 3
- Tool to append lat/lng to a CSV of tree measuements HOT 2
- Add rewards text
- TreesCount shutdown text changes and link removal
- Text change
- Support shutting down TreesCount HOT 1
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 nyc-trees.