GithubHelp home page GithubHelp logo

etabits / node-penguin Goto Github PK

View Code? Open in Web Editor NEW
70.0 70.0 14.0 1.33 MB

Automatically generates administration pages based on your Mongoose models.

License: GNU General Public License v2.0

Makefile 0.18% CoffeeScript 3.75% JavaScript 57.29% CSS 37.08% Shell 0.06% Less 0.11% Pug 1.52%

node-penguin's People

Contributors

aularon avatar panozzaj avatar semgrep-bot avatar sogko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-penguin's Issues

Array type how to set?

when i set a Array type value,the value will become to the String type.

how can i set a Array value or how to extend it?

Views doesn't work if the main app's default view engine is not jade

Please change

_render: (req, res, template, locals) =>
res.render path.resolve(__dirname, '../views/', template), locals

to

_render: (req, res, template, locals) =>
res.render path.resolve(__dirname, '../views/', template + '.jade'), locals

(added '.jade' suffix)

in file src/index.coffee
in line 314

PS: I don't know how to make pull requests...

Error with unique index

if you have sotheing like this in a model:

username: {
    type: String,
    required: true,
    index: {
      unique: true
    }
  }

You will get an error while adding a duplicate:

/home/edsadr/Sites/lotto/admin/node_modules/mongoose/lib/utils.js:413
        throw err;
              ^
TypeError: Cannot set property 'error' of undefined
  at Promise.<anonymous> (/home/edsadr/Sites/lotto/admin/node_modules/penguin/src/index.coffee:451:9)
  at Promise.<anonymous> (/home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mpromise/lib/promise.js:172:8)
  at emitOne (events.js:77:13)
  at Promise.emit (events.js:166:7)
  at Promise.emit (/home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
  at Promise.reject (/home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mpromise/lib/promise.js:111:15)
  at Promise.error (/home/edsadr/Sites/lotto/admin/node_modules/mongoose/lib/promise.js:95:15)
  at handleSave (/home/edsadr/Sites/lotto/admin/node_modules/mongoose/lib/model.js:95:15)
  at /home/edsadr/Sites/lotto/admin/node_modules/mongoose/lib/utils.js:408:16
  at /home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/collection/core.js:123:18
  at /home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1195:7
  at /home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1903:9
  at Server.Base._callHandler (/home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
  at /home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:487:18
  at [object Object].MongoReply.parseBody (/home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
  at [object Object].<anonymous> (/home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:445:20)
  at emitOne (events.js:77:13)
  at [object Object].emit (events.js:166:7)
  at [object Object].<anonymous> (/home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)
  at emitTwo (events.js:87:13)
  at [object Object].emit (events.js:169:7)
  at Socket.<anonymous> (/home/edsadr/Sites/lotto/admin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:440:22)
  at emitOne (events.js:77:13)
  at Socket.emit (events.js:166:7)
  at readableAddChunk (_stream_readable.js:146:16)
  at Socket.Readable.push (_stream_readable.js:109:10)
  at TCP.onread (net.js:517:20)

Multi-dimentional Collection field values not showing up

Hi folks,

I've a problem when my models are multi-dimensional. What I mean is, when my user model look like this:

// Single-dimensional scheme
var userSchema1 = mongoose.Schema({
  email    : String,
  password : String,
};

node-penguin works perfectly fine, but when my models look like:

// Multi-dimensional scheme
var userSchema2 = mongoose.Schema({
  local    : {
    email    : String,
    password : String,
  }
};

the admin fields show up empty. The field names show up like "local.email" and "local.password", which is perfectly fine, but the values are empty.

I am not sure on how to fix that but if anyone could give me some guideline, I can definitely give it a shot and even make a pull request if I get successful.

Thanks,

Example problem

Hi!
I am trying to run penguin example, but when I run coffee server.coffee I get:
`
Could not find model for { base: 'nodes', conditions: { type: 'p' }, slug: 'pages' }
We only have these models: [ 'File', 'files' ]/home/ubuntu/node-penguin/src/index.coffee:176
ret = merge(true, defaults.model$p, model.$p, overrides, {
^

 TypeError: Cannot read property '$p' of undefined
  at Admin.getModelDetails (/home/ubuntu/node-penguin/src/index.coffee:135:44)
  at Admin.getModelDetails (/home/ubuntu/node-penguin/src/index.coffee:1:1)
  at /home/ubuntu/node-penguin/src/index.coffee:67:43
  at /home/ubuntu/node-penguin/src/index.coffee:126:11

at Object.oncomplete (fs.js:108:15) `

I am running node 0.10.25 and all dependencies have been installed nicely..

CoffeeScript

Is it possible to use the project without CoffeeScript?
This is the error I get: Error: Cannot find module './src/'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.