Create new record based on old one - ruby-on-rails-4

I'm newbie here and I'm building CRUD app on Ruby on Rails ( ruby 2.1.5, rails 4.1.6 ) with ActiveScaffold (latest from git repo). I've done CRUD actions successfully, but now I want to create new record, based on old record to improve speed of filling.
How can I add "edit and create new" link to the right (where show and delete links located, that will create new record with same fields as in selected record, so I can fast edit some fields (date for example) and create new record?

Eureka! All that I need was active_scaffold_duplicate gem.
Also some search by word "duplicate" in ActiveScaffold group. Sorry for such easy question, my brain needs to relax :)

Related

Django - creating an CRM like app makes me trouble

I would like to create an app which will help generate offers. Let's assume I have two apps in Django project:
offers which allows to: display offers list, creating the new ones
and updating an existing offer.
warehouse which allows to: display all goods added to warehouse, creating new ones, and updating existing goods.
During creating new offer I want to have a possibility to add some of the warehouse goods to the offer and set some additional parameters like: price, quantity and so on to print it on the offer. I want to achieve this using Bootstrap modal pop-up.
How should my models, and views files looks like to achieve this?
Should I use Many to Many relation ?
P.S. I am not sure if You even understand my doubts :D

Adding new field in Django model

I am currently working on a Django project with around 30 models and there are lots of relations(For example, foreign key relations) between the models.
My doubt is "After 6 months, let's say I want to add a new field(s) in one of the model/table(s) in models.py, and make migrations, the new migration files will get created without affecting the initial migration files which were created 6 months ago."
Will the relations be maintained after adding new columns in different tables? (or) do I have to go to pgadmin console and tweak them accordingly?
One way is to erase all the migrations and start fresh, but this is not recommended often especially if there is production data (or) there are frequent changes in the database schema.
#Mahesh, You may use --fake-initial to avoid the existing tables error at the time of new migrations(When you want to add new column).
Relation will be maintained since you already declared it and unless you change it in a new migration.
How to add a new field to a model with new Django migrations?
And in Docs: https://docs.djangoproject.com/en/3.0/ref/django-admin/#cmdoption-migrate-fake-initial
If you don't change Django version, adding new fields on models will not create any problem, even after many years. But, there are some situations this might create problems. For example, if Django is updated and you have installed the latest version.

Duda con opencart

I'm developing a TPV App for OpenCart to my final project of my advanced cycle called Administration of network systems.
Going into the study of the database and when programming, I have problems with the CART table. It is necessary column sesion_id in order to see what the client is adding to the cart. How can I get that value to add it to my final project?
You are able to reach the '$this->cart' variable from anywhere this library (https://github.com/opencart/opencart/blob/master/upload/system/library/cart/cart.php) contains all you need most of the time. If you want to create your own queries you are able to reach the session id through '$this->session->getId()'.

sitecore: Serialization and package designer

I have a large amount of data(content created by user, not developer) created in Sitecore.
I know that in order to transfer large amount of data from one environment to another, I need to serialize all the content first.
My question is, after I serialize the content, do I need to create a designer package that contains the data I want to move? Or after I serialize, I use the serialized file?
Serialization is an option, but you could also create a package through the Package designer, download it and install it on the other environment.
If you are installing big packages, it is a good practice to set the value of Indexing.UpdateInterval in the web.config to 00:00:00 to prevent starting the Lucene indexer during the package install which results in much longer install times.
You don't need to create a package, use the serliazied file and update via the UI as below.
To update an item from the text file:
In the Content Editor, select the item that you want to update.
On the Developer tab, in the Serialize group, click Update Item.
To update an item with all its subitems from the file system:
In the Content Editor, select the parent item that you want to update with all its subitems.
On the Developer tab, in the Serialize group, click Update Tree.
To update the whole database:
In the Content Editor, select any item.
On the Developer tab, in the Serialize group, click Update Database
You can also use the "Transfer Item to Another Database" feature.
Just select the database where you want to go, go to Control Panel, Database, Transfer Item to Another Database.
This will open a wizard. Then you can select the Source items (the items you want to transfer to another database), then select the Target database and select where you want the items to be in the tree (i.e. under Home or some other node).
For some more information you can go to this blogpost by Sam J. Griffin, which explains it step by step.
One very important side-note though - don't copy the /sitecore/templates/sytem if you want to do all templates. This will result in some circular reference issues. If it's just content that you're copying it should be fine.
If you have a spare $149 then you should also take a look at the new Sitecore synchronization tool from Hedgehog:
http://www.hhogdev.com/Products/Razl.aspx

vTigerCRM 5.4 New entity and field behavior

I’m a newbie on vTiger development and I’m wondering if this feature is possible to implement:
I would like to have a new entity on vTiger for Zip Code. This entity will have the Zip Code, Street name, Neighborhood, City and State.
I would like to link the Zip Code on Contacts module to this new entity and, when someone pick up a zip code from the picklist, it will fill automatically the Street, City, State fields on Contacts.
This should work on New Record or Editing Records.
Any clue about this?
Thanks in advance and best regards,
creating modules in vtiger easy. check vtiger payment module . bye following this sample module you willl get an idea about module development. Also have a look on developer guides