What is Django/python equivalent of this - Display textarea content with line breaks in html page?

2009-01-10 Thread zweb
Javascript: document.getElemnetById(’textareacontent’).value.replace(/\n/ g,’’); PHP: preg_replace(”/\n/”,””,$_REQUEST['t1']); Ruby: (teaxtareacontent).gsub(/\n/,””) ( reference - http://rkutti.wordpress.com/2008/01/31/display-textarea-content-with-line-breaks-in-html-page/) --~--~-~--

How to receive Emails in my django app

2009-01-16 Thread zweb
i can send emails easily using django. I want to set up an email address, where users can send email to the app (designated email address) and my django application receives it, parses it and stores it in database. What would be the easiest way to do it. ie " To receive email from users in Djan

How to display html text in database back on screen?

2009-02-13 Thread zweb
I have tiny mce editor instead of text area for description field. For rich text markup it generates and stores text with HTML markup in database. Now When I display this field data as {{form.description}}, I think django automatically converts <> to < > for security reasons. Any way to stop it

django-tinymce plugin question

2009-02-13 Thread zweb
I am using django-tinymce widget instead of text are widget. It is displaying the formatting menu bar on bottom instead of top of the field? Anyway to tell it to show formatting menu bar on top of the editor area? --~--~-~--~~~---~--~~ You received this message beca

two html and django forms on a page issue?

2009-03-02 Thread zweb
I have two html forms on a page. Each html form has a django form associated. One form has validations. When I submit the form (form1) which does not have validations, it submit the other form (form2) on page as well and triggers the validation on the form2. I do not want the form2 to validate on

Re: Viewing uploaded files ?

2009-06-21 Thread zweb
I can add the field uploadedfile in model. what type is it and What should I store in it? On Jun 21, 8:56 pm, Kenneth Gonsalves wrote: > On Monday 22 June 2009 09:16:59 ydjango wrote: > > > 2) How do I dynamically get the url of the uploaded file? is it as > > simple as /site_media// > > where

Re: Trying to understand Django and Python from a C++ perspective

2009-06-30 Thread zweb
What book or resource would you recommend to learn advanced Python? (other than python docs) On Jun 30, 7:49 am, James Bennett wrote: > On Mon, Jun 29, 2009 at 5:19 PM, Mark Jones wrote: > > What is the python Magic going on here to make this possible? > > So, you want to read up on how Python d

Using email as username for django auth

2009-07-04 Thread zweb
i just increased the size of username in auth_user table to 100 and I enter email as user name from my register user web page. Django auth is working fine. I use my own form and view but django's authenticate and login methods. It did not give me any errors saying I cannot enter or use (at) sig

Re: ChoiceField, TypedChoiceField, ModelChoiceField and empty_label

2009-07-05 Thread zweb
I also agree this is a needed feature. On Jul 3, 5:17 pm, maplye wrote: > I also agree that > > 2009/7/3 ristretto.rb : > > > > > Hello, > > > I have stepped through code, and cruised the django docs, forums, and > > internet in general looking for how to setup an empty label with > > TypedChoic

TIME_ZONE = 'UTC' how does it work?

2009-09-05 Thread zweb
I am on mac os x and linux. I use mysql How does the TIME_ZONE='UTC" in django settings.py work? If i enter date time from web page and store it in mysql db. And no timezone is associated with the datetime, does django assumes datetime is in UTC and saves it without changing or does it assume it

Pytz time conversion issue

2009-09-05 Thread zweb
When I convert from Pacific time to UTC to db local Timzone: America/Los_Angeles to db local_dt 2009-09-07 00:00:00-08:00 to db utc_dt 2009-09-07 08:00:00+00:00 when convert from UTC to Pacific time utc_dt 2009-09-07 08:00:00+00:00 local_tz America/Los_Angeles local_dt 2009-09-07 01:00:00 Ameri

DST or not

2009-09-05 Thread zweb
Is there any way to know if for a timezone , on a praticular date time, is DST active or not? it is required by localize command of pytz. How to find it programatically? >>> est_dt = eastern.localize(loc_dt, is_dst=True) >>> edt_dt = eastern.localize(loc_dt, is_dst=False) --~--~-~--~~

Pytz time conversion issue

2009-09-05 Thread zweb
Converting from local to utc: local Timzone: America/Los_Angeles local_dt 2009-09-17 00:00:00-08:00 utc_dt 2009-09-17 08:00:00+00:00 ( after converting from local to utc) when I convert back from UTC to America/Los_Angeles, I get back local_dt 2009-09-24 01:00:00 which is one hour from where I

Re: Pytz time conversion issue

2009-09-05 Thread zweb
,dt.second)) On Sep 5, 2:47 pm, zweb wrote: > Converting from local to utc: > > local Timzone: America/Los_Angeles > local_dt 2009-09-17 00:00:00-08:00 > utc_dt 2009-09-17 08:00:00+00:00 ( after converting from local to utc) > > when I convert back from UTC to America/Los_Angeles,

I18n and varying text sizes on web page

2009-05-06 Thread zweb
Externalizing text for I18N is a great idea. But size of the text can vary quite a lot depending on the language. How do you make sure space for the text on web page resizes appropriately so that string does not get cutoff or page does not look ugly. How do you design and build such a page/form

Re: Looking for something lighter than Sproutcore or Cappuccino that integrates well with Django

2009-05-10 Thread zweb
Hi, I am also looking at Qooxdoo. What has been your experience so far? Will it integrate with Django templates and views? On Apr 8, 2:19 pm, Raymond Cote wrote: > Rob Madole wrote: > > The reason I'm posting is to ask the community if they have know of > > anything that is at a higher level

Re: Why django? Framework design or language

2009-06-14 Thread zweb
What would you consider a very good language? What is missing or irritating in python that makes you think python is not a very good langauge. I have been using python for couple of years, mainly as Django, and I am at this point neutral to it. On Jun 14, 4:23 am, Joshua Partogi wrote: > On Jun

Image for amazon EC2

2009-09-14 Thread zweb
Can you please refer me to any good images for Linux, Django 1 or 1.1, mysql, apache images? or alternatively any good blog or instruction on how to host a django based web application on EC2 with mysql backend. --~--~-~--~~~---~--~~ You received this message becau

Django error

2009-09-19 Thread zweb
When I try to download a file through django in IE , I get [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1] response = func(request, response), referer: http://www.com [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1] File "/home/ pmc/webapps/test/lib/python2.5/django/http/util

Django error

2009-09-19 Thread zweb
When I try to download a file through django in IE , I get [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1] response = func(request, response), referer: http://www.com [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1] File "/home/ pmc/webapps/test/lib/python2.5/django/http/util

Django error

2009-09-19 Thread zweb
When I try to download a file through django in IE , I get [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1] response = func(request, response), referer: http://www.com [Sun Sep 20 05:34:20 2009] [error] [client 127.0.0.1] File "/home/ pmc/webapps/test/lib/python2.5/django/http/util

Django Tiny Mce: focus on tab

2009-10-01 Thread zweb
I have a tinymce field like this... When I tab, the cursor just skips the tinymce text area and moves to next field. ie it jumps from field tabindex 1 to field with tabindex 3. tinymce editor has tabindex 2. I am using django tinymce. If anyone has come across this problem and know answer or see

django-wikiapp reviews?

2009-10-06 Thread zweb
Has anyone used django wikiapp in production. Any reviews of this app - Features you liked? Any major issues or shortcomings one should be aware of? Any alternatives you can recommend, I should evaluate as well. --~--~-~--~~~---~--~~ You received this messag

Putting django based site on HTTPS

2009-10-26 Thread zweb
I want to serve whole of my site on HTTPS. But HttpResponseRedirect is sending to http by default. Any way to tell django that it should use https and not http I am using mod_python on one site and mod_wsgi on another. Both need to go to HTTPS --~--~-~--~~~---~--~

Re: Redirects on HTTPS

2009-10-27 Thread zweb
for me this worked SetEnvIf X-Forwarded-Proto https HTTPS=1 as specified in this thread http://groups.google.com/group/django-users/browse_thread/thread/cdece5ef2e7fd280 On Oct 26, 6:01 am, "Tim Sawyer" wrote: > I still can't get this to work (original thread > athttp://groups.google.com/

How to remove " " from text for email

2009-11-08 Thread zweb
I have description|safe|striptags but description has some " " in addition to html tags. How do I strip that off? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

How to show site down for maintenance page

2009-12-05 Thread zweb
What is the best way to show site down for maintenance page ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubsc

Equivalent of php json_encode?

2010-05-04 Thread zweb
Is there a django or python equivalent of php json_encode? the data I am converting to json has text fields that have quotes, double quotes, newlines and html tags. Creating json manually in my program without escaping or converting these special characters is causing problem on javascript side.

permissions at per specific object instance

2010-05-05 Thread zweb
"Permissions are set globally per type of object, not per specific object instance. For example, it's possible to say "Mary may change news stories," but it's not currently possible to say "Mary may change news stories, but only the ones she created herself" or "Mary may only change news stories th

wierd template issue with perms (django auth)

2010-05-10 Thread zweb
I have {% if perms.core.add_project %} which is expected to be false but it is returning true. I am running it on webfaction (mod_wsgi, python 2.5 , django 1,1,1). I do {{perms.user}} in my html on webfaction and I get - perms: set([u'core.view_project']) which is correct. and {{perms.core.add_

Bug in Django auth

2010-05-10 Thread zweb
I displayed following values in my html template. I am running it on wsgi, python 2.5 and Django 1.1.1 on webfaction. {{perms.user}}Value displayed: set([]) {{perms.core}}Value displayed: set([]) {{perms.core.add_project}} Value Displayed: True ( BUG: should be false as perms.user and per

Re: Bug in Django auth

2010-05-10 Thread zweb
On Mon, May 10, 2010 at 3:52 PM, zweb wrote: > > I displayed following values in my html template. I am running it on > > wsgi, python 2.5 and Django 1.1.1 on webfaction. > > {{perms.user}}    Value displayed: set([]) > > {{perms.core}}    Value displayed: set([]) > >

Form Validation question

2010-05-13 Thread zweb
I am using a model form to edit (change) an exisiting row in db. in clean_xxx() method I want to compare the old (existing) value versus new value. I can get new value from cleaned_data. How do I get the old (existing) value? If I do a db query to get the existing row from DB how do I get the

Re: Form Validation question

2010-05-13 Thread zweb
I am doing this form = ContactForm(request.POST) # A form bound to the POST data if form.is_valid(): # All validation rules pass As clean is called by is_valid() and at this point form in bound to POST data, I cannot use self.instance unless I do this form = ContactForm(request.POST,

Django CSV module encoding issue

2010-05-14 Thread zweb
I am using DJango CSV module and doing writerrow() on some text data generated through tinyce text editor. I am getting following error ascii' codec can't encode character u'\\u2019' in position 337: ordinal not in range(128) for some reason it cannot handle the single quote in text. How do I

Any Experiences with Sphinx Search and Django-sphinx?

2010-06-01 Thread zweb
I am looking to provide search. All content is in MYSQL DB in innodb tables. That rules out Mysql full text search option, which would have been my first choice. Other option I am looking at it is Sphinx search with django-sphinx. Any experiences with it good and bad? Other thing I looked at is H

How to do user defined fields in Django?

2010-06-18 Thread zweb
I want users of my app to be able to define their own fields in addition to the already existing fields. These fields will be displayed on webpage, in form and saved in database. Fields can be of any of the standard types. Any way to do it in django? -- You received this message because you ar

Re: Chase Paymentech

2010-06-18 Thread zweb
I thought Chase Paymentech uses authorize.net. Please correct me... so any sample code to integrate django based web app to authorize.net without going to chase or authorize.net hosted pages? On Jun 18, 11:09 am, surtyaar wrote: > Hi Bobby, > > You might be interested in a django clone of the

Django Sphinx or haystack Xapian

2010-06-19 Thread zweb
I need to implement search solution over models in mysql. Anyone has experience with both or has gone through same decision making? What should I consider before choosing one or other? (Mysql text search will not work as I use INNODB. Solr is powerful but I heard it is very memory hungry and it

Re: Django Sphinx or haystack Xapian

2010-06-19 Thread zweb
one. My views are based on quick reading of material and opinions on web and not on my experience yet. Once I will try haystack xapian this weekend and let you know. On Jun 19, 10:54 am, Nick Arnett wrote: > On Sat, Jun 19, 2010 at 9:21 AM, zweb wrote: > > > (Mysql text search w

Real time search using Django Sphinx or haystack Xapian

2010-06-19 Thread zweb
ch engine. Risk is search index result could return stale data or I might get duplicates. 2) Use an appoach like yours - " copy of the searchable text in a MyISAM table and using the MySQL search on it." On Jun 19, 10:54 am, Nick Arnett wrote: > On Sat, Jun 19, 2010 at 9:21 AM, zw

Jaspersoft or Pentaho with Django?

2010-06-25 Thread zweb
Has anyone used Jaspersoft or Pentaho with DJango or Python in production? Are there any Python equivalent of Jaspersoft/Pentaho? Any experiences? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us..

Personalization and preferences?

2010-07-01 Thread zweb
On my web pages I have labels for text fields. I want user to be able to personalize the labels. Example : default label: Employee, alternative is that user can choose - Associate or Staff Member. Depending on which label an user chooses, all screens should show that label for that user. Other us

Django Personalization and Preferences?

2010-07-02 Thread zweb
On my web pages I have labels for text fields. I want user to be able to personalize the labels. Example : default label: Employee, alternative is that user can choose and save- Associate or Staff Member as label to be shown on all screens. Approach I can think of: 1. When user logs in - gets

many to many and different requests - Strange behavior?

2010-07-08 Thread zweb
I am seeing unexpected strange behaviour. I have two tables: student and study_class which have many to many relationship. 1. when user A (student a) logs in, in run time he does, student_a.study_classs = [class_physics] #in DB, this student does not have class_physics #does not Save. 2. U

Django auth/many to many issue?

2010-07-09 Thread zweb
if i do, request.user.groups = [group1] Sometimes it saves this in DB auth_user_group , sometimes it does not. I do not have any save() stmt. What is the expected behavior? I do not want it to save it in DB without explicit save, How do I achieve that? -- You received this message because you

Django auth/many to many issue?

2010-07-09 Thread zweb
if i do, request.user.groups = [group1] Sometimes it saves this in DB auth_user_group , sometimes it does not. I do not have any save() stmt. What is the expected behavior? I do not want it to save it in DB without explicit save, How do I achieve that? -- You received this message because you

How to modify many to many data without auto saving to DB?

2010-07-09 Thread zweb
Assume there is many to many between publication and article. (example from django docs) By default following stmt will auto save the relationship between a_publication and article11 in database. a_publication.articles = [article11] how do I get that so that it changes only in memory (for sessio

how to dynamically update model fields?

2010-07-09 Thread zweb
I want to provide a method as follows, def update_some_model_field(key, field_name, value): '''user provides the primary key of row, field name in model and the value and the method updates the field for that row with the value''' 1. model_obj = Some_model.objects.get(pk = key) 2. model_obj."

Django causing unnessary 301 permanent redirect

2009-12-24 Thread zweb
in fire bug I see my program issue http://localhost:8000/readme?startIndex=0&results=25 301 MOVED PERMANENTLY http://localhost:8000/readme/?startIndex=0&results=25 200 OK Any way to avoid this 301 MOVED PERMANENTLY ? -- You received this message because you are subscribed to the Google Grou

auth_group: dropping unique on name

2010-01-19 Thread zweb
I am planning to drop unique key constraint on "name" column of auth_group table. Any possible issues it may cause? thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To

Re: auth_group: dropping unique on name

2010-01-19 Thread zweb
Since all my looks up are by id and I am not using admin, I should be ok. I was not sure if django auth framework used it internally anywhere. On Jan 19, 6:03 am, Karen Tracey wrote: > On Tue, Jan 19, 2010 at 3:17 AM, zweb wrote: > > > I am planning to drop unique key constra

packager, installer and upgrade?

2010-01-26 Thread zweb
I have one django app using Mysql which I want to package and install easily on various servers. I want it be to be easy non tech user kind of installer. 1) Would you know of any open source or commercial software I can use for this purpose? 2) What is the best way to push upgrades to the servers

Python app Installers

2010-01-27 Thread zweb
What is the best way to build installer for python/django based software product ? Like in Microsoft world you can have .exe and installshield? I need to way which can guide user to setup database, run DB script, set up parameters and guide him through installation. Also want to give the option to

read only django admin

2010-01-28 Thread zweb
Is it possible to have a read only django admin, ie user cannot add, delete or update. User can only view data. or may be one user can be view only and other user has add/delete / update as well in Django admin. How to do that? -- You received this message because you are subscribed to the Goog

admin error

2010-01-30 Thread zweb
Upgraded to 1.1.1 added admin for first time per instructions in settings.py and urls.py after upgrading to 1.1.1. No admin.py at this point. created new super user logged in to admin console for first time. and got the following error: In template /Library/Python/2.5/site-packages/django/contr

TemplateSyntaxError at /admin/ - 'module' object has no attribute 'rindex'

2010-01-31 Thread zweb
after login to admin, now I get this error, any clues on what to look for? using django 1.1.1 Ashish TemplateSyntaxError at /admin/ Caught an exception while rendering: 'module' object has no attribute 'rindex' Original Traceback (most recent call last): File "/Library/Python/2.5/site-packa

Re: TemplateSyntaxError at /admin/ - 'module' object has no attribute 'rindex'

2010-01-31 Thread zweb
In my urls.py I see only two possible places where I do not have quotes, 1.(r'^admin/', include(admin.site.urls)), I tried putting include('admin.site.urls')) but it could not find 'admin.site.urls' 2. (r'^register/$', register,{'opensource':True}), True is not in quotes. But it is workin

Regression

2010-02-20 Thread zweb
What are best practices to regress django views? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegr

ORM: get, filter and DoesNotExist

2010-04-04 Thread zweb
after some debugging, just found out that filter method does not throw DoesNotExist while get does. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this grou

Re: code repetition in views

2010-04-12 Thread zweb
To Summarize, two options are, 1) Template method pattern which Thierry suggested http://en.wikipedia.org/wiki/Template_method_pattern 2) Django Decorators On Apr 10, 11:38 pm, Thierry Chich wrote: > I have written my functions as méthods of classes. Then it allow to   > use inheritance. > > L

ORM Query question

2010-04-12 Thread zweb
how do i do this kind of condition in django orm filter: ( 1 < a < 5) or ( 20 < b < 70) select * from table where (a between 1 and 5) or (b between 20 and 70) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email t

Profiling tools?

2012-10-21 Thread zweb
I am using Django 1.3.1 I want to know in my application how much time is taken by a) database access b) creation of XML c) other parts of code. What would be some good tools to profile my application? The code to be profiled is in django view and uses Django ORM and Python 2.6 and lxml to ge

Django for non web clients

2013-06-29 Thread zweb
I am writing an Python application which will expose REST API. It will be client agnostic. In future I will provide a Web client and a mobile client and may be a rich desktop client. These clients will connect to application using the REST api only. Should I use Django for this? or is Django

Re: Django for non web clients

2013-06-30 Thread zweb
s [2]. > > I am planing to use Django with one of the above rest frameworks to serve > RESTful APIs and a web client in backbone.js which will consume the APIs > as well. > > [1] - https://github.com/aregee/moksaya > [2] - http://sugarlabs.org > On Jun 30, 2013 12:13 PM, &qu

How to profile Django App?

2013-07-31 Thread zweb
I have a web page that is loading very slow. It uses a Javascript tree grid component - data loaded via XML - XML generated by LXML - Django view - Django ORM - MYSQL DB. I need to find out where is the performance bottleneck. It could be one or more of the above components. What are the best

Are Web frameworks useful in mobile first world?

2013-08-05 Thread zweb
Are web frameworks useful in mobile first world of today? With apps required to support multiple front ends including Mobile and Web, is using a web framework like ROR or Django more of a liability. Would not a light weight rest framework be better? ( Note: I really like Django. It is an aweso

Locking?

2013-08-06 Thread zweb
Can we use "with LOCK" in django views. I am using Apache, mod_wsgi, Django 1.3.1, mysql. Any conflicts or Known issues. -- 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,

Stripped Django?

2014-01-20 Thread zweb
I am planning to use django rest as rest API server. In one presentation I read, that stripped Django as REST server outperforms some other microframeworks. What would be stripped django? -- You received this message because you are subscribed to the Google Groups "Django users" group. To uns

Dyanmically changing Django Storage?

2014-01-27 Thread zweb
I am planning to use django-storages. It uses django settings, as DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' I read it is bad practice to change django settings during runtime. I am not using Django's FileField. During run time, based on file size and type, I want to use

Angular and Django

2014-06-22 Thread zweb
I was looking at Angular and looks like it does many of the thing Django Templates does but on the client side. Are you using Angular with Django? How is the experience? What are the /pros/cons? What are using django for and what are you using angular for? Is django pretty much a rest framewor