Re: Multiple Databases support in 1.2

2010-01-07 Thread cschand
Thanks Russ On Jan 7, 4:20 pm, Russell Keith-Magee wrote: > On Thu, Jan 7, 2010 at 6:51 PM, cschand wrote: > > When I run syncdb command it creates tables for default (dbtest1 > > database) only. How can I create tables for db2? Is it possible to > > create at runtime? &g

Multiple Databases support in 1.2

2010-01-07 Thread cschand
How we can create tables for the databases other than default? I have two databases and the settings are DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'dbtest1', 'USER': 'root', 'PASSWORD': 'pass', 'HOST': '', 'PORT': ''

Re: how to add more params in url

2008-12-18 Thread cschand
check this snippet http://www.djangosnippets.org/snippets/840/ Satheesh On Dec 19, 9:05 am, mono wrote: > I means if I have three param( I think it is very frequent ), the > style of writing method seem somehow inconvenient. > > eg; > > in code area which handle param1 > if ... url = ?par

Re: change i18n language through hyperlinks

2008-10-09 Thread cschand
Even then you want in get method you can use the below code. In view from django import http from django.utils.translation import check_for_language from django.conf import settings def set_language(request, lang_code): """ Patched for Get method """ next = request.REQUEST.get(

File reading error - Different results on localhost and live server

2008-10-03 Thread cschand
On Oct 3, 5:03 pm, cschand <[EMAIL PROTECTED]> wrote: > I tracked where the error coming form. It's at the time of reading the > file > > In local system the output is > > >>> import os.path > >>> base = os.path.join(os.getcwd(), 'external

Re: PYTZ showing error on live host

2008-10-03 Thread cschand
\x8c\xa0\x00\x00EST\x00' >>> and in hosting server (webfaction server) the out put at the time or read the data is >>> fp.read(data_size) '\x9cN\xa6\x9c\x9c\xbc \xf0\xcbT\xb3\x00\xcb\xc7Wp\xcc\xb7V\x80\xcd \xa79p\xce\xa0s\x00\xcf\x87\x1bp\x03p9 .

PYTZ showing error on live host

2008-10-03 Thread cschand
Hi all I have a problem with pytz. In my local system i tried with pytz and its working fine >>> from pytz.tzfile import build_tzinfo >>> import os.path >>> base = os.path.join(os.getcwd(), 'external_apps/pytz/zoneinfo') >>> tz = build_tzinfo('US/Eastern', open(os.path.join(base, 'US', 'Easter

Re: Must Have Python resources

2008-07-21 Thread cschand
The django book is based on version 0.96 and it last updated on December 2007. Now people are using latest SVN and Version 1.0 is at our door steps Satheesh On Jul 21, 5:44 pm, Amirouche <[EMAIL PROTECTED]> wrote: > On 21 juil, 11:11, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > On 21-Jul

Re: ViewDoesNotExist 'index' attribute in contrib.admin.views.main

2008-07-21 Thread cschand
Did you add admin.autodiscover() in urls.py? I think the problem due to this read http://www.djangoproject.com/documentation/admin/#hooking-adminsite-instances-into-your-urlconf Satheesh Florencio Cano wrote: > The problem is that in the last versions in the repository of Django > the Admin inte

Re: Model Inheritance in new-forms admin

2008-07-18 Thread cschand
Hi Russ The problem is not solved in the ticket Satheesh On Jul 18, 4:13 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Fri, Jul 18, 2008 at 7:00 PM, cschand <[EMAIL PROTECTED]> wrote: > > > When I tried model inheritance in new-form

Model Inheritance in new-forms admin

2008-07-18 Thread cschand
When I tried model inheritance in new-forms admin, I faced some problems The below is the code i tried class Reporter(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) email = models.EmailField() def __str__(self): ret

Re: How can I delete the default sqlite3 db?

2008-07-13 Thread cschand
create a folder called db in your project folder and in your settings file import os DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = os.path.join(os.path.dirname("__file__"), 'db/ test.db') here test.db is your sqllit

Re: How to force user login before do anything

2008-07-08 Thread cschand
If your REQUIRE_LOGIN_PATH is different in settings you can use this middleware http://www.djangosnippets.org/snippets/136/ Satheesh On Jul 8, 2:25 pm, Daniel Hepper <[EMAIL PROTECTED]> wrote: > Writing a middleware is probably a good solution. > > You can use this > one:http://superjared.com/

Re: include in QuerySet

2008-02-20 Thread cschand
Thank you karen. It works. cschand On Feb 20, 7:04 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, Feb 20, 2008 at 8:32 AM, [EMAIL PROTECTED] < > > [EMAIL PROTECTED]> wrote: > > > Sounds like you want a QNot, they work like Q: > > >

how to set initial value for select multiple

2008-02-13 Thread cschand
form by network_form = NetworkForm() My problem is i want to set initial value for the given network CheckboxSelectMultiple field.. Is there is any way to go it? Thanks in advance cschand --~--~-~--~~~---~--~~ You received this message because you are

Re: Who wants to work when money comes for free

2007-11-20 Thread cschand
Hi Salim Please stop these type of stupid ads here On Nov 20, 2:38 pm, Salimc <[EMAIL PROTECTED]> wrote: > Dear All, > > Finally a program that seriously pays for just watching the adds. > You have to just click the links in their system and watch the add for > 30 seconds and that's it your a

Re: Dynamic ImageField

2007-11-08 Thread cschand
Hi Marcin It's working... Thankyou very much :) cschand On Nov 8, 6:46 pm, Marcin Mierzejewski <[EMAIL PROTECTED]> wrote: > Hi, > > Yes, you > can:http://scottbarnham.com/blog/2007/07/31/uploading-images-to-a-dynamic...http://code.djangoproject.com/wiki/CustomUploa

Dynamic ImageField

2007-11-08 Thread cschand
Hi all, Can we make dynamic ImageFields? upload file to /media/avatar/ username or userid/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@go

Re: i18n model field not translated

2007-11-05 Thread cschand
Try this name= models.CharField(verbose_name=_('name'), help_text=_('This is the help text'), max_length = 255) On Nov 6, 9:51 am, otonk <[EMAIL PROTECTED]> wrote: > I did.. > > from django.db import models > from django.utils.translation import ugettext_lazy as _ > --- code emmited ---

Re: i18n model field not translated

2007-11-05 Thread cschand
Hi otonk Use ugettex_lazy form models from django.utils.translation import ugettext_lazy as _ cschand On Nov 6, 9:15 am, otonk <[EMAIL PROTECTED]> wrote: > Hi, I am working on a multilingual project, mainly in indonesia and > english. > i tried to do i18n on my model fields bu

Dynamic initial value for verify email

2007-10-25 Thread cschand
Hi I am using form_for_instance to edit user my view is def edit(self): user = request.user UserForm = forms.form_for_instance(user, form=EditProfile, fields=('email')) my basefom class class EditProfile(forms.BaseForm): def __init__(self, *args, **kwargs): super(EditProfileForm, s

Combine multiple models together

2007-10-25 Thread cschand
Hi all Can we combine multiple models together to create a Form by form_for_instance method? Now my view is def edit_user(request): user = request.user profile = user.get_profile() email_notification = EmailNotification.objects.get(user=user) UserForm = forms.form_for_instance(user)

Re: Serving static media on the development server

2007-10-10 Thread cschand
You want add the style sheet still.css on admin control panel or application? On Oct 10, 11:21 am, "Nikola Stjelja" <[EMAIL PROTECTED]> wrote: > i'm a noob in Django, and I'm currently learning it. I tried to use style > sheets from an external css file but it didn't work. I copyed the code from

Re: Get path translated

2007-10-09 Thread cschand
Hi Thomas Yes, It worked cschand --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this g

Get path translated

2007-10-08 Thread cschand
Hi all Can I get the path of the redirected/translated 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-users@googlegroups.com To unsubscribe f

Re: choices/, how to get rid of the dashes?

2007-10-02 Thread cschand
I am also struck on this... I need output as Select your gender Male Female we are waiting for your valuable comments cschand --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Objects.get() need to limit 1 record

2007-10-01 Thread cschand
Yeah its working. I gave .filter(..)[0] and handled the IndexError, then it works Thankyou for everyone for helped me especially Nis Jørgensen cschand --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

Re: Should Django have a road map?

2007-10-01 Thread cschand
Stefan's observations have very interesting points. I am also looking forwad to replies cschand --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Objects.get() need to limit 1 record

2007-10-01 Thread cschand
Thanks for you replies but one thing... there are some differences between get and filter from get return obj is user model obj but in filter it is recordsets... (I don't know i am right or not) Can you clarify this? --~--~-~--~~~---~--~~ You received this mess

Objects.get() need to limit 1 record

2007-09-30 Thread cschand
there any way to limit to return only one data.. ? thanks in advance cschand --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroup

Django - Password field and manipulators

2007-09-13 Thread cschand
I have a login form. The model follows class Login(models.Model): user_name = models.CharField(max_length=20) password = models.CharField(max_length=20) In my view i am trying to create a login form using manipulator def login(request): manipulator = Login.AddManipulator() form