Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Commit

Permalink
Removed dependency on narwhal/util.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmosx committed Jul 18, 2010
1 parent aa5f474 commit f3b7a66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/google/appengine/ext/db/forms.js
Expand Up @@ -110,7 +110,7 @@ ModelForm.prototype.asList = ModelForm.prototype.asUl = function () {

for (var i in properties) {
var p = properties[i];
html.push('<li id="' + p.name + '-field"><label for="' + p.name + '"' + (p.required ? ' class="required"' : "") + '>' + p.verbose() + '</label>' + p.getFormField(obj) + '</li>');
html.push('<li id="' + p.name + '-field"><label for="' + p.name + '"' + (p.required ? ' class="required"' : "") + '>' + (p.verboseName || p.name) + '</label>' + p.getFormField(obj) + '</li>');
}

return html.join("");
Expand Down
8 changes: 4 additions & 4 deletions lib/google/appengine/ext/db/properties.js
Expand Up @@ -14,8 +14,7 @@ var TYPES = require("google/appengine/api/datastore/types"),
Key = TYPES.Key,
GeoPt = TYPES.GeoPt;

var util = require("narwhal/util"),
utils = require("google/appengine/utils"),
var utils = require("google/appengine/utils"),
users = require("google/appengine/api/users");

// property constructor helper.
Expand Down Expand Up @@ -46,11 +45,12 @@ var Property = exports.Property = function (options) {
if (this.required == undefined) this.required = false;
if (this.indexed == undefined) this.indexed = true;
}

/** REMOVE me (dependency on narwhal-lib not worth it)
var util = require("narwhal/util");
Property.prototype.verbose = function () {
return (this.verboseName || util.title(this.name));
}

*/
Property.prototype.validate = function (value) {
if (this.empty(value)) {
if (this.required) throw new BadValueError(this.verbose() + " is required");
Expand Down

2 comments on commit f3b7a66

@polgfred
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Will be nice to remove this step from the setup process.

@gmosx
Copy link
Owner Author

@gmosx gmosx commented on f3b7a66 Jul 22, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, will remove it soon...

Please sign in to comment.