How to copy data from one server (mysql) to another server(mysql) on regular basis. Need to replicate data

2016-06-14 Thread sushovan majumdar
Hello,
I have to move data from database server to new database server. Schema is 
same for both.
I want to write a cron job which would keep replicating data from old 
server to newer one.
In future I will throw away the old database server. 

I was looking into database routers in django to achieve this 
(https://docs.djangoproject.com/en/1.9/topics/db/multi-db/) but I couldn't 
decide how the solution would look like,

I can write a new django app in old server and setup database router in 
that?
Can some point me to existing solutions regarding this or how can I achieve 
this?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7e302759-8714-41dd-9244-2da5c71e14e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Dynamic forms data is not getting sent in the POST

2015-10-20 Thread sushovan majumdar
I'm trying to add dynamic forms to my inline formset using the steps 
mentioned in the post: Add a dynamic form to a django formset using 
javascript in a right way 


I have inline formsets which i'm rendering using crispy forms.

rendering code in template:


{{ formset.management_form|crispy }}


{% for form in formset.forms %}

{% crispy form formset.crispy_helper %}

{% endfor %}
  


empty form template is used for adding new rows:

 
{% crispy formset.empty_form formset.crispy_helper %}
Add profile_kvp I have a small javascript code to handle on click on the button and updating the html and management form: $(document).ready(function() { $('.add-profile_kvp').click(function(ev) { ev.preventDefault(); var count = parseInt($('#id_profile_kvp-TOTAL_FORMS').val()); var tmplMarkup = $('#item-template').html(); var compiledTmpl = tmplMarkup.replace(/__prefix__/g, count); $('div#items-form-container').append(compiledTmpl); // update form count $('#id_profile_kvp-TOTAL_FORMS').val(count+1); });}); When I click the button Add profile_kvp button i'm able to update the DOM properly with new values and it's looks fine in browser. Problem appears when i submit the formset then I don't see the dynamically added forms/row in formset in views.py and so not able to view dynamically added values in server side. In server side i see new rows as empty rows without data. I see total forms value updated but all new forms are empty. All the dynamically added forms went as empty forms and didn't have the values which I entered in the browser. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4ff3595f-6eb4-4faf-a248-0d3aac8e3d4c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

Re: Dynamic forms data is not getting sent in the POST

2015-10-21 Thread sushovan majumdar
Thanks James. I changed the rendering to move the fieldset inside the form 
tag and it works. Thank you so much

On Wednesday, 21 October 2015 10:58:31 UTC-4, sushovan majumdar wrote:
>
> Hi James.
> I'm copying the rendered HTML from browser view source:
>
> 
> 
>  
>  
>  
>  
>
>  
>  
>  
>  Configuration
>  Status
>  Testing
>  
>  
>  
>  Welcome,
>  Sushovan.
>  
>  
>  Admin Editor
>  
>  Logout
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  Host group: hostmon-relay__development__app
>  Profile: solaris_clone 
>  
>  
>  
>  
>   "o0IELXj2bHKlofgXI7VTUGMMhimpc2Wu">
>   default="">
>   >
>   type="button" value="Cancel">
>  
>  
>
>
>  
>  
>  
>  
>   
>   
>   
>   "#profile_kvp" aria-expanded="true">Optional Key, Value Pairs Added to 
> All Types  
>   "true">
>   
>   
>  
>  
>  
>  
>
>
>  ="hidden" value="4">  "profile_kvp-INITIAL_FORMS" type="hidden" value="1">  "id_profile_kvp-MIN_NUM_FORMS" name="profile_kvp-MIN_NUM_FORMS" type=
> "hidden" value="0">  "profile_kvp-MAX_NUM_FORMS" type="hidden" value="1000">
>
>
>  
>  
>  
>  
>  
>
>
> "div_id_profile_kvp-0-key" class="form-group">  
>  maxlength="255" name="profile_kvp-0-key" type="text" value="1">  
>  
>   "form-group">   "profile_kvp-0-value" type="text" value="1">   
>"div_id_profile_kvp-0-DELETE" class="form-group">  
>  ...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bfe14e45-1cd3-4027-afde-2b1e8b26dbdd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


what is best way to pass form from non editable view to a editable window then save it and send values back to previously non editor view

2015-11-06 Thread sushovan majumdar
I have a django view which has simple form with key value pair. 
I have made the fields non editable. I'm providing a edit button which will 
open a new window dialog and there i will load the same form in editable 
view and provide option to save or add new rows to form.
When user clicks on save on second window i want it to close and initial 
parent view to be refreshed with new values of the form.

I have never done this so I would appreciate if someone helps me understand 
on how to achieve this. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/04772ec8-db26-457e-8252-612bbb27e21b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.