Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //KREIRANJE
- Project.Products.create({
- //ProductID : 42066798, // vec kot 500 000 za zihr
- ProductName : 'Extra Very Hot Sauce',
- SupplierID : 10,
- CategoryID : 2,
- QuantityPerUnit : 10,
- UnitPrice : 666,
- UnitsInStock : 2500,
- UnitsOnOrder : 10,
- ReorderLevel : 5,
- Discontinued : 0
- }).complete(function( err, prod){
- console.log(err);
- console.log("dodal v products");
- })
- //BRISANJE
- if(ass.ProductID == 42066798){
- ass.destroy().on('success',function(u){
- if(u && u.deletedAt){
- console.log("destroyed dis");
- }else{
- console.log("sumthin went rong mejbi");
- }
- })
- }
- //SPREMINJANJE
- Project.find({ where: {title: 'aProject'} }).on('success', function(project) {
- if (project) { // if the record exists in the db
- project.updateAttributes({
- title: 'a very different title now'
- }).success(function() {});
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement