Re: time date formatting

2009-11-22 Thread Rama Vadakattu
> This clearly does not work ;) > > {{ pick.date "r" }} Why the above will not work? On Nov 21, 3:36 am, matches wrote: > If I want to format the current datetime for an rss feed, I do: > > {% now "r" %} > > I want to format a date the same way coming from a DB in this format > "2009-11-18 08:00

Re: Login Session

2009-11-07 Thread Rama Vadakattu
You can simple use inbuilt user authentication provided by django. What problem are you facing with it? Any way if you are interested in building your own authentication engine you need to do the following: you can do this in several way one way is 1) Store cookie in user browser (you can store

Re: How to restrict True value to only one row in table column

2009-10-18 Thread Rama Vadakattu
Overriding save() is the best place to put that logic and it should work well with the admin also (other way is by means of signals) On Oct 18, 3:45 pm, Tomasz Zieliński wrote: > Maybe you can use something like this: > > http://stackoverflow.com/questions/1346765/unique-constraint-that-all... >

Re: form problem

2009-10-18 Thread Rama Vadakattu
Simple Capture the form variable and send it to another template def view(request): user_text = request.GET['user_text'] return render_to_reponse("html",{'user_text':user_text}) --rama On Oct 18, 7:26 pm, A_Swtos wrote: > I have a form like this: > > > Text: >     maxlength="20"

Re: need hlep

2009-10-13 Thread Rama Vadakattu
make sure you have installed the django properly. open a python shell: type : import django import django.core if the import does not work it means django has not installed properly. http://docs.djangoproject.com/en/dev/ On Oct 14, 9:32 am, Gin wrote: > when i set my test webserver root > > C:

Re: how to get back to a view requiring login

2009-10-12 Thread Rama Vadakattu
Very simple: 1.Once you are in login page you need to store url to which you need to go. How should you do that? protected view === def protected_view(request) : if user is not authenticated : url = request.getpath() # method which actually

Re: 'NoneType' object has no attribute 'widget'

2009-10-01 Thread Rama Vadakattu
'importance' field is already comming from model. Why did you defined again in the forms? (remove it and check out whether error is occurring or not) On Oct 1, 2:33 pm, dijxtra wrote: > On Sep 30, 5:12 pm, Karen Tracey wrote: > > > > > On Wed, Sep 30, 2009 at 10:53 AM, dijxtra wrote: > > > > I

Re: Database Consistecy using Django ORM

2009-10-01 Thread Rama Vadakattu
On one thing which i can guide you is you can use 1.django evolutions Link : http://code.google.com/p/django-evolution/ 2.south LInk: http://south.aeracode.org/ to add a new column to an already created table via django. On Oct 1, 2:14 pm, Geobase Isoscale wrote: > Hi  Everyone, > > I would l

Re: Efficiently searching a tree of FKs

2009-09-22 Thread Rama Vadakattu
Below are some thoughts on how to do the above efficiently: 1) Create a temporary table (or Model) with two fields Class Temp(...): personid = FK(Person) searchstring = TextField() 2) When every a perso

Re: About using django-tinymce

2009-09-21 Thread Rama Vadakattu
[Off topic suggesting another rich text powerful editor] You can also try django CK editor 1) which is easy to user 2) which is powerful,fast and more robust than TInyMCE http://code.google.com/p/django-ck/ 3) with every ease you can also integrate directly. On Sep 22, 6:45 am, taijirobot wrote

Re: usernames for auth.User are too restrictive for my company's clients

2009-07-15 Thread Rama Vadakattu
1.Simply extend the User model by using UserProfile Technique More details : http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/ 2.You can also customize your authentication needs More details : http://groups.google.com/group/django-users/browse_thread/thread/c943

Re: Deployment dilemma

2009-07-14 Thread Rama Vadakattu
file at server. > > > > On Tue, Jul 14, 2009 at 9:33 PM, Alex Gaynor wrote: > > > On Tue, Jul 14, 2009 at 10:46 AM, Rama Vadakattu > > wrote: > > >> I have a django project with N number of dependencies to other > >> packages. > >> Now i wan

Deployment dilemma

2009-07-14 Thread Rama Vadakattu
I have a django project with N number of dependencies to other packages. Now i want to deploy the project on production server? As of now iam doing this. 1.Move the django project to production server. 2.install the dependencies on production server similar to that of the way i have done on local

Re: django test db

2009-07-03 Thread Rama Vadakattu
you can use the setting TEST_DATABASE_NAME http://docs.djangoproject.com/en/dev/ref/settings/#test-database-name --rama On Jul 3, 2:36 pm, Michael Stevens wrote: > Hi. > > Is there a nice way to use a separate db user when running tests? > > I don't want my main user to have to have permission

Re: "django-notification" app installation

2009-07-02 Thread Rama Vadakattu
after import notification just try to do this dir(notification) > which list all the methods ,classes in the package and see what it contains then atleast you will get a rough idea of what is going wrong. On Jul 3, 2:21 am, Anthony wrote: > Hi, > > I'm having trouble installing thi

Re: Django Sessions / Multidimensional List

2009-07-02 Thread Rama Vadakattu
please have a look at this section http://docs.djangoproject.com/en/dev/topics/http/sessions/#when-sessions-are-saved --rama On Jul 2, 2:15 am, bjoern_mainz wrote: > Hi, > > what i try do do is (in plain python): > > products = [] > products.append({"product" : "foo","quantity": 5}) > products.

Re: for the thousandth time... No module named django.core.handlers.modpython

2009-06-29 Thread Rama Vadakattu
As the error is with import please try to do this Just open a python shell and try do the import >>> import django.core.handlers.modpython if it works fine then we are sure that modpython is present on the python path and the problem is not with import .. On Jun 30, 3:31 

Re: How to use MEDIA_URL on flatpages content?

2009-06-25 Thread Rama Vadakattu
Please ignore the last line.. On Jun 25, 2:40 pm, Rama Vadakattu wrote: > you can put {{MEDIA_URL}} > > but while displaying instead of displaying it directly  just do the > below > > from django.template.loader import render_to_string > from django.template imp

Re: How to use MEDIA_URL on flatpages content?

2009-06-25 Thread Rama Vadakattu
you can put {{MEDIA_URL}} but while displaying instead of displaying it directly just do the below from django.template.loader import render_to_string from django.template import Context, Template t = Template("flat page content goes here") newflatpage = t.render({},context_instance=RequestCon

Re: How to load fixtures only once in django unit tests?

2009-06-24 Thread Rama Vadakattu
Very well explained. Thanks Russell Keith-Magee On Jun 23, 4:58 am, Russell Keith-Magee wrote: > On Tue, Jun 23, 2009 at 1:21 PM, Rama Vadakattu > wrote: > > > In unit tests i need to load few fixtures  i have done as below > > >   class TestQuestionBankViews(TestCase):

Re: Issue on using emailID as the username

2009-06-23 Thread Rama Vadakattu
1. i don't know whether it is expected behavior or not. But here are some ways to solve the above problem. --- Why it is not accepting @ character in admin ? As the username of UserCreation form ( from django.contr

How to load fixtures only once in django unit tests?

2009-06-22 Thread Rama Vadakattu
In unit tests i need to load few fixtures i have done as below class TestQuestionBankViews(TestCase): #load this fixtures fixtures = ['qbank',] def setUp(self): login = self.client.login (email="m...@gmail.com",password="welcome") def test_start

Re: Request aware template loader

2009-06-22 Thread Rama Vadakattu
have you gone through the below url: http://www.b-list.org/weblog/2007/nov/01/django-tips-template-loading-and-rendering/ On Jun 22, 5:49 pm, z0n3z00t wrote: > I have a common site that is used by different clients.  Each client > wants to be able to custom-brand the site to their liking. > > H

Re: Django 1.0.2 foreign key display puzzle

2009-06-22 Thread Rama Vadakattu
Usually Foreign keys are displayed as drop down select list where user can choose one is multiple options. Foreign keys are usually initialized with list of tuples [(internal value,display),(interavalue1,displayvalue2)..] if you want to present just prepare the list of tuples and give it to

Re: django-logging

2009-06-19 Thread Rama Vadakattu
t; message. > > I think I like this solution of using the logging module.  I guess > with mod_python your stdout messages make it into apache's logs but > I'm using mod-wsgi which actually errors when it gets something on > stdout and throws all stderr messages away.  Time

Re: Trouble with a django snippet FieldAccessForm (per-field user access for forms derived from models)

2009-06-19 Thread Rama Vadakattu
i could not able to understand the problem... after reading one i can quickly tell is you are not passing keyword arguments so kwargs will be always empty please look at the belowlink for more information: http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/ On

Re: django-logging

2009-06-19 Thread Rama Vadakattu
print messages at info level mlogger.debug("completed the question paper at present reviewing it") Hope the above is clear for you to start... --rama vadakattu . On Jun 18, 11:20 pm, "eric.frederich" wrote: > I need some a

Re: Preset foreign key in Model Form

2009-06-19 Thread Rama Vadakattu
i think ForiegnKey uses ChoiceField as it has to display n number of choices. How should we intialize choice field? --- it should in this form source = [(actual value,display value),(actual value,display value) ]

Re: querystring redirect

2009-06-15 Thread Rama Vadakattu
This can be done with javascript as follows : 1) View/middleware (depends on your needs) detects the redirection url 2) put down the redirection url in the context and redirect to template say abc.html 3) in abc.html a) put the message "your are leaving our site" b) write javascript

Re: How to preset a value to a field on a ModelForm

2009-06-15 Thread Rama Vadakattu
else: form = FooForm() foo.date = request.session['date']# we know request.session ['date'] has a value form = FooForm(instance=foo) ... You don't need this line==> foo=for

Re: Change AuthenticationForm error message

2009-06-14 Thread Rama Vadakattu
one simple idea ( it may or may not be feasible ) that you can use is 1) write down a middleware 2) examine the context which has a form and with the above error message and replace it with your new error message On Jun 14, 5:45 pm, Vitaly Babiy wrote: > Hey Everyone, > I need to change th

Re: openid

2009-06-14 Thread Rama Vadakattu
Recently i worked with openid i have used the below package for implementing it. http://code.google.com/p/django-openid-consumer/ It is basically a fork of simonwillison django-openid implementing new openid features. I did not face any problems and successfully implemented openid on my site. -

Re: need to understand some basics on facebook

2009-06-12 Thread Rama Vadakattu
have a look at the below link http://uswaretech.com/blog/2009/02/how-to-build-a-facebook-app-in-django/ this may help you in understanding the integration of your application into facebook platform On Jun 12, 5:11 pm, gganesh wrote: > Hi, > I'm not going to integrate my application into faceboo

Re: How to doing something after change record of DB with admin view?

2009-06-11 Thread Rama Vadakattu
>From my point of view use of signals correctly fit your needs. On Jun 12, 5:31 am, Shuge Lee wrote: > For some reason, I want to create a static file after user change > record of DB with admin view, I need to use > signalhttp://docs.djangoproject.com/en/dev/topics/signals/#topics-signals > ,

Re: Pass the user from one view to another one

2009-06-10 Thread Rama Vadakattu
Once user has logged in you can access user in every view by means of request as below def view2(request): user = request.user On Jun 11, 6:55 am, ariest wrote: > I have two views and I want to pass the user variable from login view > to parent1 view but I dont know how to do that. > > Can

Re: Processing Forms in HTML docs

2009-06-10 Thread Rama Vadakattu
1. just put down the appropriate view url for the action attribute of your form. On Jun 11, 8:56 am, Abhishek Nanda wrote: > Hi > > I wanted some help about processing forms in an html document returned > as the result of a given query. I am developing an opac system . now > once a

Re: Iterating for the form.errors dictionary

2009-06-08 Thread Rama Vadakattu
you have to use the below code to print messages instead of keys {% for key,message in form.errors %} {{ message|striptags }} {% endfor %} On Jun 9, 11:21 am, Rama Vadakattu wrote: > {% for message in form.errors.key %} >       {{message|striptags}} >  {% endfor %

Re: Using block content tag

2009-06-08 Thread Rama Vadakattu
>> the layout has been altered? Why so? What do you mean by this? On Jun 9, 11:24 am, vishy wrote: > Hi, > > For my project, I decided to use base.html file.After including it in > a couple of pages, the layout has been altered? Why so? How does > blockcontent render? > thks --~--~-~--~-

Re: Iterating for the form.errors dictionary

2009-06-08 Thread Rama Vadakattu
{% for message in form.errors.key %} {{message|striptags}} {% endfor %} The above will print keys instead of values as message is key not a value. On Jun 9, 11:06 am, Tom wrote: > Hi all, > > Leveraging the default login view, I want to use my own login.html to > show all th

Re: ifequal with a tuple value?

2009-05-29 Thread Rama Vadakattu
i hope you are encountering the problem as request.GET.subseries is string and id is integer and they are not matching. On May 29, 3:52 pm, mbdtsmh wrote: > I have the problem below when I use a tuple to try and match a request > item; i.e., it never matches. I can do the same thing with a list

Re: Best way to filter my query in calendar format.

2009-05-22 Thread Rama Vadakattu
Have a look at the below link http://journal.uggedal.com/creating-a-flexible-monthly-calendar-in-django This may help you in solving your problem. On May 22, 12:12 pm, laspal wrote: > Hi, > My DB looks lie: > >     id > date                                           msg >     20              

Re: uneditable fields

2009-05-14 Thread Rama Vadakattu
So you need dynamic form as below Class MyForm(forms.ModelForm): fields ... def __init__(self, user,*args , **kwargs): super(MyForm,self).__init__(*args,**kwargs) if user is not superuser :

Re: Gravatar django apps

2009-05-14 Thread Rama Vadakattu
Integrating with Gravatar is very easy 1) Get MD5 hash of user's email id import hashlib def getMD5(self): m = hashlib.md5() m.update(self.user.email) return m.hexdigest() 2) and prepare image url as below http://www.gravatar.com/avatar/{{user-email-MD5- ha

Re: Include Forms in a Template

2009-05-14 Thread Rama Vadakattu
BY passing instance of form as context to the template and saying {{form.as_table}} in the template. On May 14, 5:22 pm, aruns wrote: > Hi, > > i have included many static pages in my template using > > {% include staticpage.html %} > > i have started using views and forms, so i am tring to in

Re: newbie: syncdb doesnt update schema after model change?

2009-04-16 Thread Rama Vadakattu
OR you can use django-evolutions which evolves the database schema in sync with the models. More details at : http://code.google.com/p/django-evolution/ On Apr 17, 10:29 am, zayatzz wrote: > If the tables of this app hold no info, then you can do python > manage.py reset appname. This clears all

Problem with request.session.set_expiry(0)

2009-04-10 Thread Rama Vadakattu
hi, 1) I have done request.session.set_expiry(0) which means user session should expire when he closes the browser. But it is not happening i have tested it several times? Any hint on what can be wrong? HOw did it test? --- By closing browser and opening

Re: Using custom user model for authentication

2009-04-07 Thread Rama Vadakattu
Please have a look at the below thread which answers the above question: http://groups.google.com/group/django-users/browse_thread/thread/c943ede66e6807c/2fbf2afeade397eb#2fbf2afeade397eb On Apr 8, 9:03 am, Tom wrote: > Hi experts, > > I am a first time web-developer who decided to use python we

how to use email instead of username for user authentication?

2009-03-31 Thread Rama Vadakattu
The authentication model provided along with django is based on username. What to do to change the authentication based on email instead of username? To be more specific ~~~ With username authentication , to login user we do the following user = authenticate(name,password)

how to use email instead of username for user authentication?

2009-03-31 Thread Rama Vadakattu
The authentication model provided along with django is based on username. What to do to change the authentication based on email instead of username? To be more specific ~~~ With username authentication , to login user we do the following user = authenticate(name,password)

Re: How to access an element in a list using forloop.counter in django templates?

2009-03-09 Thread Rama Vadakattu
Thanks for the clarification. On Mar 10, 10:05 am, Malcolm Tredinnick wrote: > On Mon, 2009-03-09 at 21:47 -0700, Rama Vadakattu wrote: > > understood. > > > But Malcom, > > > 1.i feel doing restructuring of data in views for this purpose is not > > appropriate.

Re: How to access an element in a list using forloop.counter in django templates?

2009-03-09 Thread Rama Vadakattu
, Malcolm Tredinnick wrote: > On Mon, 2009-03-09 at 21:21 -0700, Rama Vadakattu wrote: > > I have a list in template. > > I need to access that list based on a forloop.counter. > > > For example : > > > if forloop.counter is 1 then i need to access list[1] > >

How to access an element in a list using forloop.counter in django templates?

2009-03-09 Thread Rama Vadakattu
{% endwith %} { %endfor %} 3. {% for k in klist %} {{ mylist|slice:forloop.counter:forloop.counter }} #This code is not working { %endfor %} Regards Rama vadakattu --~--~-~--~~~---~--~~ You received this message because you are

Re: Figuring out what has changed at save()

2009-03-07 Thread Rama Vadakattu
Keep track of a variable which tells us the action user is currently doing like "draft,publish,edit "? the first time the user does a publish you need to trigger an action. details: How to know the current action of user? --- a) 1.

Re: Figuring out what has changed at save()

2009-03-07 Thread Rama Vadakattu
Keep track of a variable which tells us the action user is currently doing like "draft,publish,edit "? the first time the user does a publish you need to trigger an action. details: How to know the current action of user? --- a) 1.

Re: Django Application's Response Time

2009-03-06 Thread Rama Vadakattu
if you really want to measure the page response time (amount of time that a page has taken to download on your local computer) 1) you can use firebug (popular) : it shows all the request and reponse... 2) AOL's web based test tool : webpagetest.org 3) IBM's page detailer (desktop

Re: Figuring out what has changed at save()

2009-03-06 Thread Rama Vadakattu
So you need to trigger an action the first time you save an object in to the database. -- Class A: #self.id is None whenever a particular instance has not been saved into a database #override save method in the object as follows def save(self) : firstime =

Re: How to reverse lookup a RSS feed url?

2009-03-02 Thread Rama Vadakattu
On Mar 2, 1:10 pm, Malcolm Tredinnick wrote: > On Mon, 2009-03-02 at 00:02 -0800, Rama Vadakattu wrote: > > Thanks Malcolm.Understood very clearly. > > > Following the same approach i have used following code in my templates > > {% url djorum_feed_url   ca

Re: How to reverse lookup a RSS feed url?

2009-03-02 Thread Rama Vadakattu
w should i use the url tag to form the above Actually i need this url in my template On Feb 28, 5:10 am, Malcolm Tredinnick wrote: > On Fri, 2009-02-27 at 01:20 -0800, Rama Vadakattu wrote: > > i am using django feed syndication framework. > > > 1) .in urls.py >

How to reverse lookup a RSS feed url?

2009-02-27 Thread Rama Vadakattu
i am using django feed syndication framework. 1) .in urls.py feeds = { 'category': LatestTopicsByCategory, } urlpatterns += patterns('', url(r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed' , {'feed_dict': feeds},name='djorum_feed_url') ,

Re: Need to create a account_number column which is concat of id and some variable

2009-02-13 Thread Rama Vadakattu
there are many ways of solving this problem. please see the below thread for more details where similar problem was discussed : http://groups.google.com/group/django-users/browse_thread/thread/3a9960139307aaec/77b712ee9c08795b#77b712ee9c08795b Another method which you can use is =

Re: using models interfaces as a communication layer (not to db directly)

2009-02-12 Thread Rama Vadakattu
1) AppServer has to send XML means (i assume) DJango running on Apache has to send XML means let's route the URL to point to view which sends the respective XML URL is the means by which the frontend (javascript) will interact with appSERVER (django APP) means in (django

Re: Changing the name of a project

2009-02-12 Thread Rama Vadakattu
i think it is always good to decouple the imports and INSTALLED_APPS (in settings.py) from projectname. one way of doing this is a) in INSTALLED_APPS (settings.py) use just APPNAME instead of PROJECTNAME.APPNAME (it still works as the project path is on sys

Django popular stories feed / widget

2009-02-12 Thread Rama Vadakattu
we strive hard to keep track of latest happening in the django . To assist in this process we have developed a feed/widget which brings out the popular stories in Django by examining (via friendfeed) 1) Google Reader shared items 2) Deliciuos, M

Re: how can i create alphabetic list

2009-02-05 Thread Rama Vadakattu
Yes he can use the below 1.string.ascii_lowercase 2.string.ascii_uppercase As iam new to python,django i couldn't able to recollect it while answering. On Feb 5, 3:57 pm, Masklinn wrote: > On 5 févr. 09, at 11:40, Rama Vadakattu   > wrote:> k = [chr(i)  for i in range(97,12

Re: how can i create alphabetic list

2009-02-05 Thread Rama Vadakattu
k = [chr(i) for i in range(97,123)] The above will give you a list from a to z. if you want capital letter list [A,Z] then you should use the respective ascii values range(65,92). On Feb 5, 3:25 pm, Muslu Yüksektepe wrote: > hi; > i need to use a-z list for my photo album. i wanna use link for

Re: How do I add a Custom ID Field that increments?

2009-02-05 Thread Rama Vadakattu
CUSTOM_ID---ID ~ INV1 -- 1 INV2 ---2 INV33 . . . i think you need INV1 for display purposes and also i hope it does not matter much whether you store 1 or INV

Re: Django newbie question re: porting from Google App Engine to Django standalone

2009-02-01 Thread Rama Vadakattu
Please have a look at the below link: http://code.google.com/appengine/articles/pure_django.html May be it helps you in porting the app from appengine to django. --rama On Feb 1, 5:16 am, "Mark.Petrovic" wrote: > Good day.  I'm new here, as well as a new (all of two months of > experience) Pyth

Re: how to avoid hardcoding of logfile path in logging.conf file

2009-01-28 Thread Rama Vadakattu
on. Thanks Eric for your code. --rama On Jan 27, 7:48 pm, Eric Abrahamsen wrote: > On Jan 27, 2009, at 9:45 PM, Rama Vadakattu wrote: > > > > > Eric, > > can you please show me the code snippet of specifying a logfile in > > settings.py. > > Sure, here'

Re: how to avoid hardcoding of logfile path in logging.conf file

2009-01-27 Thread Rama Vadakattu
Eric, can you please show me the code snippet of specifying a logfile in settings.py. On Jan 27, 6:37 pm, Eric Abrahamsen wrote: > On Jan 27, 2009, at 9:28 PM, Thomas Guettler wrote: > > > > > Rama schrieb: > >> please look at the below logging.conf file. > >> ... > >> can any one  guide me on h

Re: could not able to schedule a standalone python script which uses a django module

2009-01-26 Thread Rama Vadakattu
port setup_environ import settings setup_environ(settings) -- now it is working well. THanks On Jan 27, 9:23 am, Malcolm Tredinnick wrote: > On Mon, 2009-01-26 at 19:46 -0800, Rama Vadakattu wrote: > > i configured the DJANGO_SETTINGS_MODULE in /etc/profile.this means > > that

Re: could not able to schedule a standalone python script which uses a django module

2009-01-26 Thread Rama Vadakattu
i configured the DJANGO_SETTINGS_MODULE in /etc/profile.this means that it is a system wide environmental variable and can be used every where. On Jan 26, 8:09 pm, Daniel Roseman wrote: > On Jan 26, 1:55 pm, Rama wrote: > > > > > i have a standalone python script which uses a django module. i n