Re: calling perl script from HTML on submit button

2012-08-13 Thread Pervez Mulla
Thank you for your time and concern, Actually the entire back-end is in perl so, Am using Django for front-end. So am asking is there any why to call perl objects in python . On Mon, Aug 13, 2012 at 3:35 PM, Marcin Tustin wrote: > You do realise that django is a python

Re: NoReverseMatch Error

2012-08-13 Thread Karen Tracey
On Mon, Aug 13, 2012 at 10:46 PM, Syam Palakurthy wrote: > Hi - I could not find any explanation that fixed the problem, until I ran > across this person's abridged Django tutorial: > http://tony.abou-assaleh.net/web-development/stripped-down-django-tutorial > > It's

Re: NoReverseMatch Error

2012-08-13 Thread Syam Palakurthy
Hi - I could not find any explanation that fixed the problem, until I ran across this person's abridged Django tutorial: http://tony.abou-assaleh.net/web-development/stripped-down-django-tutorial It's basically a line in the details template, which should be: Instead of: I'm not sure

blocktrans inside a with tag

2012-08-13 Thread Jason Buckner
I would like to use a blocktrans tag inside a with tag so I can dynamically pass values to multiple blocktrans blocks. For instance: {% with cost="250" %} {% blocktrans with val=cost %} Blah blah ${{val}} {% endblocktrans %} . . . {% blocktrans with val=cost %} Blah blah

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
Yes you are absolutely right about Date_Format and Time_Format. But the Time_Format gives me trouble. By default it is defined as TIME_FORMAT = 'P' and the output is p.m. (see two dots) My TIME_INPUT_FORMATS = ('%I:%M %p',) produces PM (in capital case and I prefer it this way) I tried to

Model method represented as non-editable field on object edit page

2012-08-13 Thread Lachlan Musicman
Hola, I have a Person object with Class Person(model.Models): ... def get_id(self): """ This returns the worker's reference number, or "worker ID" Think like a social security number Not kept in the database as it would be extraneous The 10 is

New to Django, Question about Admin Page

2012-08-13 Thread Daniel Roseman
You haven't uncommented the admin URL itself - the second to last line of the code you posted. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: New to Django, Admin Page not Loading

2012-08-13 Thread Lachlan Musicman
On Tue, Aug 14, 2012 at 10:04 AM, judy ngai wrote: > Here is my urls.py page > > from django.conf.urls.defaults import patterns, include, url > from django.contrib import admin > admin.autodiscover() > > > urlpatterns = patterns('', > # Examples: > # url(r'^$',

Re: New to Django, Question about Admin Page

2012-08-13 Thread Melvyn Sopacua
On 14-8-2012 0:15, judy ngai wrote: > Here at the urls.py, the three lines are also uncommented But this one is not: > # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), and should be. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google

New to Django, Question about Admin Page

2012-08-13 Thread judy ngai
I apologize if I ended up sending this twice. I hit submit when google logged me out. I am new to django. Right now I am going through the tutorial. I am stuck on the creating admin page section. Here are the settings.py , you can see that the admin and the admindocs are uncommented.

New to Django, Admin Page not Loading

2012-08-13 Thread judy ngai
Here is my urls.py page from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'budgetmanager.views.home', name='home'), # url(r'^budgetmanager/',

Re: Using Forms without Request Data

2012-08-13 Thread Kurtis
I forgot to mention, I do use the Forms to also exclude certain fields. Maybe a JSON Form class would do me some good here, afterall. The one problem is that my time is limited (budget) so I've got to make sure I don't spend too much time chasing down an optimized happy path. Although, it

Re: Using Forms without Request Data

2012-08-13 Thread Kurtis
On Monday, August 13, 2012 5:37:52 PM UTC-4, Melvyn Sopacua wrote: > > > Hmm. You gain: > - an errors dict > > At the cost of: > - form field instance creation > - widget instance creation > > You can save some resources by investing in a JSONForm class and I'm > wondering if the following

Re: Using Forms without Request Data

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 23:14, Kurtis Mullins wrote: > The reason I'm using a Form (specifically a ModelForm) is to make my job of > setting up the Validation a *whole* lot easier. > > Here's the code I basically used. Maybe there's a better way to do it? > > json_object =

Re: Using Forms without Request Data

2012-08-13 Thread Kurtis Mullins
On Mon, Aug 13, 2012 at 5:10 PM, Melvyn Sopacua wrote: > > > data argument to a form instance must be a dictionary-like object. Other > then that there's no requirements. > I'm kinda curious why you need a form if you're using a non-html data > format. > > I figured it out

Re: Using Forms without Request Data

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 23:04, Kurtis wrote: > Actually, I'm creating a new object with this form. If it helps to > understand the scenario, I'm taking in JSON and creating an object out of > the data. But, I can't just pass the raw POST QueryDict because the data > doesn't map correctly by any means.

Re: multiple profile

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 21:51, Anderson wrote: > I have 3 types of users > > Clients > Students > Teachers > > and each one have different fields and AUTH_PROFILE_MODULE is not going to > work with 3 profiles. Yeah, the auth module doesn't support this very well. I'd recommend storing the shared

Re: Using Forms without Request Data

2012-08-13 Thread Kurtis
Actually, I'm creating a new object with this form. If it helps to understand the scenario, I'm taking in JSON and creating an object out of the data. But, I can't just pass the raw POST QueryDict because the data doesn't map correctly by any means. On Monday, August 13, 2012 4:55:27 PM UTC-4,

Re: Using Forms without Request Data

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 22:34, Kurtis wrote: > This may be a simple question and something I will probably just need more > time to dig in and try out. What's the best way to send data to a form > (specifically ModelForm) without using request.POST? The initial argument work for you? In short, initial

Re: Django: How to get American date format in a form?

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 22:41, Melvyn Sopacua wrote: > On 13-8-2012 17:40, houmie wrote: > >> Its just a bit odd that templates show 11:15 p.m. Slight difference in >> the formatting. Also the dates within templates are defined like Aug >> 13, 2012. Doesn't confirm with my definition in formats.py. >> Are

Re: Django: How to get American date format in a form?

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 17:40, houmie wrote: > Its just a bit odd that templates show 11:15 p.m. Slight difference in > the formatting. Also the dates within templates are defined like Aug > 13, 2012. Doesn't confirm with my definition in formats.py. > Are they stored somewhere else? No, but you need the

Using Forms without Request Data

2012-08-13 Thread Kurtis
Hey guys, This may be a simple question and something I will probably just need more time to dig in and try out. What's the best way to send data to a form (specifically ModelForm) without using request.POST? Should I just build a QueryDict object and send that in? Thanks! -- You received

Re: multiple profile

2012-08-13 Thread Anderson
Sorry :D I have 3 types of users Clients Students Teachers and each one have different fields and AUTH_PROFILE_MODULE is not going to work with 3 profiles. -- Anderson Dias Borges Senior Analyst Developer Tu cumprirás o desejo do meu coração se eu Te buscar... I can't see but I'll take my

Re: multiple profile

2012-08-13 Thread Marcin Tustin
You're going to have to be more specific. On Mon, Aug 13, 2012 at 3:36 PM, Anderson wrote: > What's the best way to work with multiple profile on Django? > > -- > Anderson Dias Borges > Senior Analyst Developer > > Tu cumprirás o desejo do meu coração se eu Te

multiple profile

2012-08-13 Thread Anderson
What's the best way to work with multiple profile on Django? -- Anderson Dias Borges Senior Analyst Developer Tu cumprirás o desejo do meu coração se eu Te buscar... I can't see but I'll take my chances To hear You call my name -- You received this message because you are subscribed to the

Re: how to let user change the language

2012-08-13 Thread Gelonida N
On 08/13/2012 12:09 PM, Marcin Tustin wrote: This list is not here to find pages in the documentation for you. The documentation has a contents page, and search. Thank you very much for your help. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Working with a Custom, Dynamic Form (using BaseForm)

2012-08-13 Thread Nick_B
Thanks for the advice Anton, > looks like you are using some additional layer before django.forms and > don't just create fields directly, so you may need to extend it too. > > Does anyone have any advice or references on extending my form to include an extra field? After searching and

Re: custom management commands: AttributeError: 'module' object has no attribute 'Command'

2012-08-13 Thread Kurtis Mullins
I'd look more into the full traceback. I haven't had any trouble with underscores either. On Mon, Aug 13, 2012 at 2:31 PM, creecode wrote: > I have many custom management command names that have underscores in them. > I've never had a problem. I believe that a management

Re: custom management commands: AttributeError: 'module' object has no attribute 'Command'

2012-08-13 Thread creecode
I have many custom management command names that have underscores in them. I've never had a problem. I believe that a management command name only needs follow python rules for naming files. On Sunday, August 12, 2012 1:44:06 AM UTC-7, Melvyn Sopacua wrote: On 11-8-2012 2:14, Matthew Meyer

Re: AttributeError

2012-08-13 Thread Satinderpal Singh
On Mon, Aug 13, 2012 at 6:06 PM, Melvyn Sopacua wrote: > On 13-8-2012 14:23, Melvyn Sopacua wrote: >> On 13-8-2012 13:47, Satinderpal Singh wrote: >> >>> I got the following error while making the tables in database using >>> syncdb command: >>> >>> AttributeError:

Re: PostGIS 2.0.0 problems

2012-08-13 Thread Reiner Marquez
hey guys, take a look at this, it saved my live on today. https://github.com/django/django/pull/249 El lunes, 6 de agosto de 2012 10:28:50 UTC-5, Oleg Korsak escribió: > > Have you tried to create new project, then new app, then new model with > PointField(geography=False) and then run

Comparing packages django-groups and django-organizations

2012-08-13 Thread Paul Backhouse
Hi, For my site I want Users to be members of groups. Groups represents a bunch of people that want to discuss something on the site. Here's a brief list of requirements: Users can apply to join a group, or be invited to join. There are objects associated with each group which members can view

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
This is brilliant. Thank you so much Melvyn. Now I can switch the cultures between British and US without having to change any code. :) I was also surprised to see that Django is using by default the military (24h) time. From what I remember the Americans usually prefer 12 hours AM/PM. So

Re: Django app to update site through email

2012-08-13 Thread Paul Backhouse
I've just noticed that Askbot seems to do a lot of this already: https://github.com/ASKBOT/askbot-devel/blob/master/askbot/management/commands/post_emailed_questions.py https://github.com/ASKBOT/askbot-devel/blob/master/askbot/mail/__init__.py I've not tested it, and I seem to remember reading a

Re: Django: How to get American date format in a form?

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 16:16, houmie wrote: > But looking at this example, 'en/' is not good enough. British English > is also `en` but the date format is European. You know what I mean? > Again the culture seems to be forgotten :( > Unless I could define the path as en-GB/ and it would still be >

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
Thanks Melvyn for the example. Interesting you get the same problem with American date output as I. So its on purpose to pick the first available input-format from formats.py. Which is very odd if you ask me. I was expecting this to be culture specific too. Ok, let see how we can fix this.

Re: forms or tastpie api?

2012-08-13 Thread Marcin Tustin
Modelforms are for creating forms that very closely map onto a model class. The questions of whether to use xmlhttprequest vs form post, or hand-written views vs tastypie generated are independent. You can still create a form with the fields you want using django's forms framework, and use

forms or tastpie api?

2012-08-13 Thread Tim
I have started building an interface for my web app; there are some manytomany "through" relationships and fks I want to simplify for users to add/update the database. I don't want them to have to think about it; just edit the data and let the app logic put all the changes wherever they're

Re: UnicodeDecodeError with non ascii app_label

2012-08-13 Thread vitalije
I have found ticket that was closed because more information was needed but not provided. It seems that it is related to my question. So I reopened ticket and pasted log information from the above message. If anyone would like to see it, here is the link:

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
Thanks Carlos, Yes I could utilize the format field as you suggested and it would work fine but this is bad. I will have customers in USA and also in Europe. Both would run from the same server, hence I need eventually enable the localization according to the user's locality.

Re: Django: How to get American date format in a form?

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 14:47, houmie wrote: > Thanks Melvyn, > > I have tried this: > > def contact_date_callback(self, field, **kwargs) : > return field.contact_date(localize=True, **kwargs) > > But the date still shows as 2012-08-13 > > note, that Aptana Studio 3.0 complained that I put `self`

Re: Django: How to get American date format in a form?

2012-08-13 Thread Carlos Palol
Try configuring your form field directly, like this: class CallsForm(ModelForm): contact_date = forms.DateField( localize=True, input_formats=['%m/%d/%Y'], widget=forms.DateInput(attrs={ 'placeholder'='Format is m/d/...', }) ) class

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
Thanks Melvyn, I have tried this: def contact_date_callback(self, field, **kwargs) : return field.contact_date(localize=True, **kwargs) But the date still shows as 2012-08-13 note, that Aptana Studio 3.0 complained that I put `self` first. Nonetheless neither version works. Any

Re: AttributeError

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 14:23, Melvyn Sopacua wrote: > On 13-8-2012 13:47, Satinderpal Singh wrote: > >> I got the following error while making the tables in database using >> syncdb command: >> >> AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type' >> >> I recently install GEOS

Re: AttributeError

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 13:47, Satinderpal Singh wrote: > I got the following error while making the tables in database using > syncdb command: > > AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type' > > I recently install GEOS library and import it to my model.py file. Any > help

Re: memcached + fcgi prefork = wrong value for a given key

2012-08-13 Thread v-tuzov
пятница, 11 февраля 2011 г., 13:52:01 UTC+4 пользователь MarcMarc написал: > Hi, > > > > My problem looks like this: when using memcached with fcgi on prefork > > mode I`m getting wrong values for a given keys. Values are > > dictionaries with keys, so I`m logging those erros like this: > >

Re: Django: How to get American date format in a form?

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 12:23, houmie wrote: > However in the forms, once I try to modify the record I get 2012-08-31 > > That doesn't seem right. Sure I could use the field format, but isn't > that hardcoded and bad practice? Setting localize=True on the form field (form, not model) should do the trick.

Re: Django app to update site through email

2012-08-13 Thread Melvyn Sopacua
On 12-8-2012 20:47, Marwan Al-Sabbagh wrote: > Ah good old fetchmail. How did I forget you. Thanks Melvyn, It looks really > really mature an full featured. As far as security and identifying the user > I was planning to use Django's Cryptographic >

AttributeError

2012-08-13 Thread Satinderpal Singh
Hi, I got the following error while making the tables in database using syncdb command: AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type' I recently install GEOS library and import it to my model.py file. Any help will be appreciated, thanks in advance. -- Satinderpal

Re: Django app to update site through email

2012-08-13 Thread Melvyn Sopacua
On 13-8-2012 12:37, Paul Backhouse wrote: > I like the idea of "secret email addresses". I think this is what > spamcop.net does. A good example is actually My Opera and I think wordpress uses something similar as well. -- Melvyn Sopacua -- You received this message because you are subscribed

Re: 回复: How to host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-13 Thread Cal Leeming [Simplicity Media Ltd]
/var/lib/stickshift/688174c010/app-root/runtime/repo/.openshift/action_hooks/build: line 7: /var/lib/stickshift/680e98b8570/pingmeebldr/runtime//bin/pip: No such file or directory Tbh, I think you need to speak with OpenShift On Mon, Aug 13, 2012 at 12:37 PM, surya

Re: 回复: How to host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-13 Thread surya
Hi Pengfei, Thanks for your post. I figured out the problem to some extent. *uwsgi 1.2.4 *current version, is having some security bugs. So, I had to revert back to *1.2.3.* * * I followed this tutorial However, I have some other problems

Re: Django app to update site through email

2012-08-13 Thread Paul Backhouse
On Sat, 2012-08-11 at 13:21 +0300, Marwan Al-Sabbagh wrote: > I'm curious you said you have already implemented this. How did you > end up doing it. Well I just have a manage.py command that uses poplib to get mail. The mail contents are then parsed for app specific keywords (Eg the id of an

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
Ahhh finally now I know what is happening: MIDDLEWARE_CLASSES = ( ... 'django.middleware.locale.LocaleMiddleware', ) It seems as soon as the LocaleMiddleware is loaded, Django gets the settings frommy browser session, Hence the dateformat is changed to European reflect my location.

Re: how to let user change the language

2012-08-13 Thread Marcin Tustin
This list is not here to find pages in the documentation for you. The documentation has a contents page, and search. On Aug 13, 2012 3:45 AM, "Gelonida N" wrote: > > On 08/13/2012 12:54 AM, Marcin Tustin wrote: > >> So, what part, exactly is a problem? What have you tried? >>

Re: calling perl script from HTML on submit button

2012-08-13 Thread Marcin Tustin
You do realise that django is a python framework? If you want to write your app in Perl, use a Perl framework. On Aug 13, 2012 5:34 AM, "Pervez Mulla" wrote: > > Hi, > > I have sign-up page, for that I have perl script to store the user details in DB .The DB code that has

Django: How to get American date format in a form?

2012-08-13 Thread Houmie
Hello everyone, For some reason the American date format is not accepted in my form. I wonder if any Django developer from US could help me with this. I suspect the timezone in the settings also affect the date format, but I am not sure. *Settings:* TIME_ZONE = 'Europe/London'

calling perl script from HTML on submit button

2012-08-13 Thread Pervez Mulla
Hi, I have sign-up page, for that I have perl script to store the user details in DB .The DB code that has is auto-generated, i.e. we can just specify objects (User Details)and then it creates read and write functions for the DB. Next step is to also auto-generate some HTML forms based on these

Re: django auth against local users

2012-08-13 Thread Joris
> > You keep saying "local machine". Do you mean the machine the user is > browsing from? That's not possible, for what should be obvious security > reasons. > -- > DR. > No that would indeed be silly. By local machine I mean local to the django install: i.e. the server. I figured that was

Re: django auth against local users

2012-08-13 Thread Daniel Roseman
On Monday, 13 August 2012 09:26:18 UTC+1, Joris wrote: > > Dear list > I've seen a number of differnent auth backends for django, but for some > reason could not find a way to have Django auth against the local system > users on the local machine (e.g. /etc/passwd). In my case Django is running

django auth against local users

2012-08-13 Thread Joris
Dear list I've seen a number of differnent auth backends for django, but for some reason could not find a way to have Django auth against the local system users on the local machine (e.g. /etc/passwd). In my case Django is running on an intranet site (CentOS6) that is also connected to windows

Re: how to let user change the language

2012-08-13 Thread Babatunde Akinyanmi
The link given was the overview page. it has links that lead you to deeper parts of the internalization framework. On 8/13/12, Gelonida N wrote: > > On 08/13/2012 12:54 AM, Marcin Tustin wrote: >> So, what part, exactly is a problem? What have you tried? > > Changing

Re: how to let user change the language

2012-08-13 Thread Gelonida N
I found now the right link to the right doc. https://docs.djangoproject.com/en/1.3/topics/i18n/internationalization/ Must have been blind. I was not seeing this link for multile times and just found the article with the Django docs search funtion. It mentions set_language(request) I'll tyr

Re: how to let user change the language

2012-08-13 Thread Babatunde Akinyanmi
Hi Gelonida, I haven't ever worked with internalization but off the top of my head after reading the documentation, if I was faced with implementing this, I would first add a field to the user profile say 'preferred_lang'. Next, I would write code that would first check if a preferred language

Re: how to let user change the language

2012-08-13 Thread Gelonida N
On 08/13/2012 12:54 AM, Marcin Tustin wrote: So, what part, exactly is a problem? What have you tried? Changing settings.LANGUAGE_CODE to another language, but this is obiously nto what I am looking for, as this does not allow to change the language on a user by use base. If anybody

Re: different language for admin/front-end

2012-08-13 Thread Gour
On Sun, 12 Aug 2012 17:33:27 +0200 Melvyn Sopacua wrote: > As you can see in the documentation [1], there's five methods by which > one can select the language once you've added LocaleMiddleware: Thank you very much. I was looking at docs, but, somehow, missed this info.