How do I create timestamp type columns in (mySQL) database?

2012-12-26 Thread Subodh Nijsure
I am working with situation where I would like to maintain timestamp (in UTC) of when a record is created or updated. mySQL offers such facility if one declares column of type 'timestamp' with attributes - default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP' However I haven't found way to decla

Replicating same model for different deployed application.

2012-12-29 Thread Subodh Nijsure
Hi, I have following situation where. My model consist of say table1, table2, table3. I am going to "host" similar data and associated web interface for multiple customers -( customer1, customer2, customer3.) they would access these application as http://hostname/customer1 http://hostname/custome

Re: Replicating same model for different deployed application.

2012-12-30 Thread Subodh Nijsure
there, any recommendations? Regards, -Subodh On Sun, Dec 30, 2012 at 8:57 AM, Amirouche wrote: > Héllo Subodh > > > On Sunday, December 30, 2012 3:57:36 AM UTC+1, Subodh Nijsure wrote: >> >> Hi, >> >> I have following situation where. My model consist of say t

DateTime field when using django-crispy-form

2013-01-03 Thread Subodh Nijsure
Hello, Sorry if this should go to some crispy-form specific mailing list. If there is such thing kindly redirect me towards it. I am using django-crispy-form to render my forms one thing which I haven't been able to do is display columns that are of data-time format with some kind of calender pic

Re: how to create a databse

2013-01-05 Thread Subodh Nijsure
On Ubuntu following works - Run: sudo dpkg-reconfigure mysql-server-5.1 Now this will allow you set password for 'root' user. Les assume you want to create user joe and create database joedb , want to assign password 'joepassword' Now login to the mysql as: mysql -u root -p'r

Source code from book djangobook.com ?

2013-01-15 Thread Subodh Nijsure
Sorry if this is a very obvious question does any body know if source code from the online book http://www.djangobook.com/ is available some where in git repo? I have searched on github and most hits are for actual book chapters. -Subodh -- You received this message because you are subscribed to

How do I prevent delete from table that has foreign key references

2013-01-20 Thread Subodh Nijsure
Hi, Say I have model that comprises of Books and Authors. Where a book may have multiple authors and this has foreignkey in the books table. Now how do I prevent deletion of an author record while the there is record in books table that has pointer an author record (via foreign key). Do i need t

Re: Multi Client Django System

2013-02-25 Thread Subodh Nijsure
Could - Django multitenant cold possibly help you? https://pypi.python.org/pypi/django-simple-multitenant -Subodh On Fri, Feb 22, 2013 at 7:43 PM, Delcio Torres wrote: > Dear Sirs, > > Maybe this is a concept question, but here we go. > > I'm doing test development to learn django and using ad

django DB optimization

2013-03-04 Thread Subodh Nijsure
Hi, I have implemented a django application that willl maintain schedule for 100s of people that work for a company. People access this schedule using desktop or mobile device to lookup their task list for current day, this week etc. Now the question is how do I scale this -- example when user jo

A generic 'search' framework for forms?

2013-03-05 Thread Subodh Nijsure
I have lot of forms in my django application and would like to present a generic way for end user to do search query, is there a package out there that allows one to construct such a thing? Example I have a form that shows customers it has fields like customer_name, customer_address , I have anoth

Multi-tenant database model with new user model?

2013-04-30 Thread Subodh Nijsure
Hi, We have old model for one of my django application that requires multi-tenant deployment. The database model I came up with is kind of _ugly_ to support the multi-tenancy. Are there any good examples of how one can write multi-tenant django application using the new AbstractUser classes? -Su

Registration module in 1.5.1 use of django.views.generic.simple

2013-05-02 Thread Subodh Nijsure
I am not certain how one goes about submitting changes to django. But if I setup my virtualenv with 1.5.1 and import the registration backend I end up getting error on importing direct_to_template. Which can be fixed with following code change. First, is this correct code change? Should this chang

Re: Registration module in 1.5.1 use of django.views.generic.simple

2013-05-02 Thread Subodh Nijsure
So adding something like this to my requirements.txt should work? -e hg+https://bitbucket.org/ubernostrum/django-registration#egg=django-registration ( Sorry if this very trivial, never have imported something from hg) -Subodh On Thu, May 2, 2013 at 12:12 PM, James Bennett wrote: > Check out

Benchmarking django application using ab (apache benchmark)

2013-05-07 Thread Subodh Nijsure
Hi, I have deployed a web site that using nginx for serving static content and apache2 (mod_wsgi) to handle the django requests. I have optimized obvious things that chrome browser show things like compression, expiration, js minification etc. Now I am looking at doing some bench marking of this

Handling delete and ability to support undo

2013-05-13 Thread Subodh Nijsure
Hi, I have requirement where users should be able to 'delete' the data from database. But at the same time we want to provide undo features. So what that essentially means is keeping column 'is_deleted' for every table and when uses delete the data set value to 1. And when users want to retrive

Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread Subodh Nijsure
This is all IMHO. One of the thing that has been missing from many django books: How do you "marry" the current best practices for --deploying-- large scale web applications when using django. What are the best practices for enabling, monitoring caching? Implementing search using haystack or som

Django crispy form layout question

2013-06-12 Thread Subodh Nijsure
I am using django-crispy form to layout some of the form fields as shown below so that the first_name, last_name appear in one row, same with primary_number, email etc. Also I have set the label to blank and using place holder to display hints to user. Div(

Re: Django-Ajax Issue

2013-07-15 Thread Subodh Nijsure
I am not sure what you mean by taking you to post view of the function. That aside, you need to include csrfmiddlewaretoken: '{{ csrf_token }}' in your data: section. data: { 'keyword': search_for, 'filter': rval, csrfmiddlewaretok

Recommendation/alternative for multi-tenancy under django

2014-07-18 Thread Subodh Nijsure
This is the first time I am trying to implement multi-tenant setup under django and hence the question. Problem/Setup - There are two companies signed up for service from portal I am developing say CompanyA, CompanyB. - Each user with this setup is identified by unique email address, users login

Re: Recommendation/alternative for multi-tenancy under django

2014-07-21 Thread Subodh Nijsure
gt; > Cheers > > > On Fri, Jul 18, 2014 at 6:56 PM, Mike Dewhirst > wrote: >> >> On 19/07/2014 3:51 AM, Subodh Nijsure wrote: >>> >>> This is the first time I am trying to implement multi-tenant setup >>> under django and hence the question. >

Unable to create migration with Error - One or more models did not validate:

2014-07-30 Thread Subodh Nijsure
Hello, I have following model definition and when I try to create a migration using command, 'python manage.py schemamigration asset_mgmt --initial' I am getting following error: CommandError: One or more models did not validate: asset_mgmt.alarmtable: 'polling_config' has a relation with model

Re: Unable to create migration with Error - One or more models did not validate:

2014-07-30 Thread Subodh Nijsure
i 2014 13:34:52 UTC+2 schrieb Subodh Nijsure: >> >> Hello, >> >> I have following model definition and when I try to create a migration >> using command, 'python manage.py schemamigration asset_mgmt >> --initial' I am getting following error: >&g

Help needed in constructing __in query

2014-08-04 Thread Subodh Nijsure
I have two tables as shown below. class AlertTable(models.Model): id = models.AutoField(primary_key=True) alarm_text = models.CharField(max_length=800,blank=False,null=False) event_type = models.SmallIntegerField(blank=False,null=False) created = models.DateTimeField() class Me

Crispy form Change default text shown for ImageField when not empty

2014-08-14 Thread Subodh Nijsure
Hello, I have following field in my model. photo = models.ImageField(null=True,blank=True,upload_to="product_images") I have defined the following layout in forms.py for this field, while using crispy-form self.fields['photo'].label = "Asset Image" self.helper.layout = Layout( 'photo',

Desperatly seeking help with ALLOWED_HOSTS

2014-08-17 Thread Subodh Nijsure
I am totally stumped why I can't get my site to work when DEBUG=False. I have entered my domain name and IP address in the ALLOWED_HOSTS I even tried putting '*' in my ALLOWED_HOST but when DEBUG=False I always get my 400.html page served to me. As soon as DEBUG=True everything works great. I ha

Re: Desperatly seeking help with ALLOWED_HOSTS

2014-08-17 Thread Subodh Nijsure
ng there > is one) > > Cal > > > On Sun, Aug 17, 2014 at 7:25 PM, Subodh Nijsure > wrote: >> >> I am totally stumped why I can't get my site to work when DEBUG=False. >> >> I have entered my domain name and IP address in the ALLOWED_HOSTS >> >

Re: Desperatly seeking help with ALLOWED_HOSTS

2014-08-17 Thread Subodh Nijsure
, such as uWSGI or gunicorn, > as it could be a problem with that. > > Another option would be to use something like Sentry to capture the errors, > or modify your `settings.LOGGING` to send to stderr. > > Cal > > > On Sun, Aug 17, 2014 at 7:46 PM, Subodh Nijsure > wrot

Caching some application data in memcache v/s in django process itself

2014-08-19 Thread Subodh Nijsure
Hello, I have application that servers time-series data for 10+ units. This data can get big and I don't want to retrieve 5-6MB worth of data from cassandra and serve it out as JSON to the client. I want to maintain cache of this time series data. I had horrible thought of just storing this data

Re: Caching some application data in memcache v/s in django process itself

2014-08-19 Thread Subodh Nijsure
Cal > > On Wed, Aug 20, 2014 at 1:07 AM, Cal Leeming [iops.io] wrote: >> >> >> >> >> On Wed, Aug 20, 2014 at 12:54 AM, Russell Keith-Magee >> wrote: >>> >>> >>> On Wed, Aug 20, 2014 at 4:27 AM, Subodh Nijsure >>> wrote:

Re: Feeling some serious timezone pain

2014-08-21 Thread Subodh Nijsure
You could consider passing the timestamp in UTC to the template and then convert it to browser's timezone using javascript function - convertUTCDateToLocalDate(data)? -Subodh On Wed, Aug 20, 2014 at 5:22 AM, christophw wrote: > Hi there, > > I'm feeling some pain while wrangling with timezones i

Generic way to create forms (not admin forms)

2014-09-15 Thread Subodh Nijsure
Hi, In my application I have situation where I would like users to define elements in a form -- things like buttons, text input fields, radio buttons etc. And save those forms as templates, and then at later time instantiate that user-defined form and save data associated with that form. ( Basi

crispy form wouldn't show form level errors

2014-10-04 Thread Subodh Nijsure
I have a form that clearly form level errors (not field level) I can print those error messages in my form_invalid method. But they are not showing up when using crispy form. I have set following options self.helper.form_error_title = "Form Errors" self.helper.form_show_errors =

Re: crispy form wouldn't show form level errors

2014-10-04 Thread Subodh Nijsure
I have tried that in my fom_invalid method it has valid messages but crispy firm is not picking it up. But if I just try to print them in template it is empty so it's getting reset between fom_invalid and template rendering? Subodh On Oct 4, 2014 10:18 AM, "Collin Anderson" wrote: > try this if

Re: django email client (reusable app) kickstarter

2014-10-08 Thread Subodh Nijsure
Why does it need to have dependence on specific database postgres? Subodh On Oct 8, 2014 5:43 AM, "Internet Profil Filip Kowalski" < bi...@internetprofil.pl> wrote: > Hi, > > I have started kickstarter campaign: > https://www.kickstarter.com/projects/112336300/open-source-email-client-based-on-

django-inplaceedit any way to remove the hint at the top?

2014-04-13 Thread Subodh Nijsure
I just started using the django-inplaceedit using latest version. It works great. [ https://django-inplaceedit.readthedocs.org ] But I want to remove the hint that it shows when showing editable items - 'Enable Edit Inline'. Is there any easy way to remove it? BTW I searched the documentation fo

Deferred reverse geo coding upon record save/update

2014-04-17 Thread Subodh Nijsure
I have application where mobile devices are collecting data from sensors, and along with sensor reading they also save gps co-ordinates where the sensor data is taken. This is uploaded to web server using REST interface on django platform. But I am trying to figure out how do I reverse geo decode

[no subject]

2014-06-22 Thread Subodh Nijsure
I have following ajax query that gets generated from my template. This is done after user has logged into the system. One thing I have noticed is very first GET request always prompts a dialog box that asks users to login with username and password. I have done console.log and csrf_token is non-nu

Unable to add CSRF token to the header

2014-06-22 Thread Subodh Nijsure
[ Sorry this is duplicate as I posted previous messages without Subject: !! ] I have following ajax query that gets generated from my template. This is done after user has logged into the system. One thing I have noticed is very first GET request always prompts a dialog box that asks users to log

How to store/model reachable data in django.

2014-06-25 Thread Subodh Nijsure
Hello I have need to store data that can be graphed. Example I have mobile app that collects temperature every 30 seconds for say 5 min and uploads these samples via REST api to my database. I happen to be using django for visualization. Question I am pondering is what is the best way to store th