Jump to content

gcaplan

Members
  • Posts

    4
  • Joined

  • Last visited

gcaplan's Achievements

Newbie

Newbie (2/6)

1

Reputation

  1. Hi Ryan Hmm - as a Postgres devotee perhaps I could mention that we've had full text indexing since the early Triassic: http://www.postgresq...arch-intro.html Much more sophisticated that MyIsam too, with lexical parsing to handle plurals etc, stopwords, synonym dictionaries and highly optimised indexing. And of course you get all the other Postgres goodies such as intelligent engineering, bomb-proof data integrity (haven't lost a byte of data in 10 years), and a sensible licence. <rant>I'm having to use MySQL for a current project, and I've been dismayed by what I've found. This is the 21st century, and they are openly admitting that their query parser is so dumb that they still haven't figured out a way to offer functioning sub-queries! They're expected "some time soon". I'm sure your clients would appreciate the option of using a database built by a community who would never dream of knowingly releasing an upgrade with 300 known crashing and critical bugs: http://monty-says.bl...1-released.html :- </rant>
  2. Ryan Great to hear from the developer! Don't really follow you here, as surely the idea is to prevent users from saving bad data? So long as you provide clear error messages how is this a problem? With jQuery it's pretty easy to provide the message as soon as users tab out of the field. Don't understand much about PW yet, but doesn't doing this in the template mean that issues will only show up at runtime? I suggested the regex idea as a quick and dirty fix, but obviously it's going to restrict use of the feature to sad geeks like us. Plus, on thinking it through, a single field for an error message would hit problems with your back-end internationalisation. Years ago I developed a flexible declarative approach and it has served me well. Some of the modern PHP frameworks use a similar idea. You develop an easily extended utility library of validations, and each validation has an error string in all active languages. The string can use template-like placeholders for parameters: "Number should be between {1} and {2}." Then you develop a simple declarative syntax for setting validations and any relevant parameters. Here's a couple of examples: is_greater_than,10 is_between,1,365 is_alphanumeric;is_max_length,256 As a catchall, you can offer access to regexes: matches_pattern, ^\$(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$,"Must be a valid USD price" Another useful feature, I find, is filters that clean up input. These are run before the validations and ensure consistent presentation. For example, for a city or postal code you might use: to_uppercase For a field in which you are entering, say, architects, you can tidy up capitalisation with: to_pretty_name If input isn't entirely trusted, you can offer a range of sanitation filters to eliminate cross-site scripting etc. This would open up the possibility of using PW for, say, social content management. The actual plumbing for this is just a few lines of code, and there are plenty validation and filter libraries to plunder. You'd be getting a lot of functionality for a small investment! I guess you'd tuck this out of the way on the advanced tab. For types with limited validation options such as numeric fields you could improve usability by offering the validation options as fields on the form instead of declarations. For text fields, the declarative string would be the most flexible, I think. You could offer popup help so users could check their options without leaving the form. Personally, I would find this pretty useful. Why not help content creators achieve consistency and correctness?
  3. Thanks guys Rolling my own fields isn't ideal, but the other advantages are compelling enought that it's worth considering. I come from the RDBMS world, so the idea of allowing uncontrained imput is rather scary. You folks have a lot of hands on experience with CMS projects - do you really find that there's no need for validation? Symphony does offer some facilities - basic, but better than nothing. A quick fix would be to add a couple of fields to the advanced tab of the field definitions (where relevant) where you could add a regex and an error message. Basic but useful?
  4. Hi folks Excited to find Processwire - a much needed breath of fresh thinking! The only downer I've spotted so far is the apparent lack of any way to constrain data entry in the admin area fields. For example to limit an integer between 1 an 32. I realise that this is a CMS and not a RDBMS, but the other option on my short-list, Symphony, seems to offer more here. Am I missing something? Or is there a practical workaround (I'm fluent in PHP & regexes and have basic JQuery)? Any advice much appreciated.
×
×
  • Create New...