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 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 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
> objects. That way I don't need to write new forms every-time, the code
> will auto generate HTML and i want to embbeded it in to Django-Framwork.
> >
> > So,
> >
> > How can execute perl scripts in Django framework,so that I
> can accomplish this function.
> >
> > Thank You
> >  Pervez
> >
> > --
> > 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 group, send email to
> django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>  --
> 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 group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 basically a line in the details template, which should be:
>
> 
>
>
> Instead of:
>
> 
>
>
> I'm not sure why this fixed the issue, but it did for me.  I'd love an
> explanation if anyone has one.
>
>
This is not a typo in the tutorial. The {% url %} variant is a faily recent
update to the current  development level of the online docs. It was added
in order to show in the tutorial best practices: url reversal by name
rather than hard-coding url paths in the template. However, it uses the {%
url %} tag syntax that is correct for the upcoming Django release, 1.5. In
order for that syntax (specifically, the quotes around polls.views.vote) to
work in the 1.4 released version, the template would also have to include
{% import url from future %}. This "from future" import is not necessary in
the current development level of code, so was not included when this change
to demonstrate how to use {% url %} was added to the tutorial development
level. However it seems that many many many people are running through the
development-level doc with the 1.4- released level code, so perhaps we
should add a note here (or more prominently elsewhere) to please be sure
you run through the online version of the tutorial that matches the level
of code you are running.

Karen

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 why this fixed the issue, but it did for me.  I'd love an 
explanation if anyone has one.

Thanks,
Syam

On Thursday, June 9, 2011 12:28:30 AM UTC-7, bh.hoseini wrote:
>
> hi there,
> this is my views.py that doesn't have any problem:
>  
> from django.shortcuts import get_object_or_404, render_to_response
> from django.core.urlresolvers import reverse
> .
> .
> .
> return HttpResponseRedirect(reverse('polls.views.results', args=(
> p.id,)))
>
> def results(request, poll_id):
> p = get_object_or_404(Poll, pk=poll_id)
> return render_to_response('(...)/polls/results.html', {'poll': p})
>
> 
> but when i edit my urls.py like this:
>
> #...
> urlpatterns = patterns('',
> (r'^$',
> ListView.as_view(
> queryset=Poll.objects.order_by('-pub_date')[:5],
> context_object_name='latest_poll_list',
> template_name='(...)polls/index.html')),
> (r'^(?P\d+)/$',
> DetailView.as_view(
> model=Poll,
> template_name='(...)polls/detail.html')),
> url(r'^(?P\d+)/results/$',
> DetailView.as_view(
> model=Poll,
> template_name='(...)polls/results.html'),
> name='poll_results'),
> (r'^(?P\d+)/vote/$', 'polls.views.vote'),
>
> --
> and open my browser with the link (http://localhost:8000/polls/id=1/vote), 
> I'd face this error: can anybody help please?
>
> Reverse for 'polls.views.results' with arguments '(id=1,)' and keyword 
> arguments '{}' not found.
>
> can anybody help?
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/2MW2j_RVlfYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 ${{val}} {% endblocktrans %}
{% endwith %}

This produces empty {{ val }} values.

Is this possible?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Gcf4-VttBFwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 change TIME_FORMAT = 'P' to TIME_FORMAT = '%p', but it breaks.



On 13/08/12 21:52, Melvyn Sopacua wrote:

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 they stored somewhere else?

No, but you need the localize filter or tag:


Wait, if this is the same data from the model, then you need to change
the DATE_FORMAT. DATE_INPUT_FORMAT is for form fields, since the form
field needs to be able to change it back to a format that python's
datetime.date will understand. DATE_FORMAT is used for plain output.



--
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 added for aesthetic reasons only
"""
return self.pk + 10
get_id.short_description = 'ID Number'

And in my admin.py I have the appropriate

list_display = ('__unicode__','birth_place','get_id')

But what I really want to achieve is for the "get_id" function to
appear on each object's edit page as an uneditable field - so that the
data entry staff have a visual reference

Is it possible to do this?

cheers

L.

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 
https://groups.google.com/d/msg/django-users/-/MhVkawQb9PIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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'^$', 'budgetmanager.views.home', name='home'),
> # url(r'^budgetmanager/', include('budgetmanager.foo.urls')),
>
> # Uncomment the admin/doc line below to enable admin documentation:
> # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> # Uncomment the next line to enable the admin:
> # url(r'^admin/', include(admin.site.urls)),
> )

Uncomment the admin in urls.py

from this:

> # Uncomment the next line to enable the admin:
> # url(r'^admin/', include(admin.site.urls)),
> )

to this:
> # Uncomment the next line to enable the admin:
> url(r'^admin/', include(admin.site.urls)),
> )

cheers
L.

> And here is my settings.py
>
> INSTALLED_APPS = (
> 'django.contrib.auth', #an authentication system
> 'django.contrib.contenttypes', #framework for content types
> 'django.contrib.sessions', #a session framework
> 'django.contrib.messages', #a messaging framework
> 'django.contrib.staticfiles', #framework for managing static files
> # Uncomment the next line to enable the admin:
>  'django.contrib.admin',
> # Uncomment the next line to enable admin documentation:
>  'django.contrib.admindocs',
> 'budget'
> )
>
> I have sync the database and started the server many times. I got the
> welcome page but when I try to do /amin or /admin/ or /admin/auth , the page
> just does not load. I got stuck on the welcome page. As you can see above
> the django.contrib.admin is uncommented and same with the
> django.contrib.admindocs. On the urls.py admin has been imported. I have
> looked through questions on stackoverflow but still can't find the answer.
> Can someone help me out please?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/acUEAQK82osJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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.

INSTALLED_APPS = (
'django.contrib.auth', #an authentication system
'django.contrib.contenttypes', #framework for content types
'django.contrib.sessions', #a session framework
'django.contrib.messages', #a messaging framework
'django.contrib.staticfiles', #framework for managing static files
# Uncomment the next line to enable the admin:
 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
 'django.contrib.admindocs',
'budget'
)

Here at the urls.py, the three lines are also uncommented

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/', include('budgetmanager.foo.urls')),

# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
)

The django page is up and running when I start the server. However no
matter how much I try
/admin or /admin/ or /admin/auth, the page just won't go to the admin
page and gets stuck on the django welcome page instead

Can anyone help me out? Do you need to show you guys any other code?

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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/', include('budgetmanager.foo.urls')),

# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
)

And here is my settings.py

INSTALLED_APPS = (
'django.contrib.auth', #an authentication system 
'django.contrib.contenttypes', #framework for content types
'django.contrib.sessions', #a session framework 
'django.contrib.messages', #a messaging framework 
'django.contrib.staticfiles', #framework for managing static files 
# Uncomment the next line to enable the admin:
 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
 'django.contrib.admindocs',
'budget'
)

I have sync the database and started the server many times. I got the 
welcome page but when I try to do /amin or /admin/ or /admin/auth , the 
page just does not load. I got stuck on the welcome page. As you can see 
above the django.contrib.admin is uncommented and same with the 
django.contrib.admindocs. On the urls.py admin has been imported. I have 
looked through questions on stackoverflow but still can't find the answer. 
Can someone help me out please? 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/acUEAQK82osJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 would definitely be a sound way to go if it doesn't take too much time.

On Monday, August 13, 2012 6:08:11 PM UTC-4, Kurtis wrote:
>
> 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 does not do the job: 
>> json_object = json.loads(request.POST['fieldname']) 
>> obj = MyModel(**json_object) 
>> obj.full_clean() 
>> obj.save() 
>>
>> -- 
>> Melvyn Sopacua 
>>
>
> Very good points! I do like the error dict but I didn't think about all of 
> the unnecessary other steps it was taking. Thanks a lot, Melvyn!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/MtzFwA8u_vUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 does not do the job: 
> json_object = json.loads(request.POST['fieldname']) 
> obj = MyModel(**json_object) 
> obj.full_clean() 
> obj.save() 
>
> -- 
> Melvyn Sopacua 
>

Very good points! I do like the error dict but I didn't think about all of 
the unnecessary other steps it was taking. Thanks a lot, Melvyn!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/s4UqegxcR_kJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 = json.loads(request.POST['some_json_field'])
> q = QueryDict('')
> q = q.copy()
> q.update(json_object)
> form = MyModelForm(q)
> 

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 does not do the job:
json_object = json.loads(request.POST['fieldname'])
obj = MyModel(**json_object)
obj.full_clean()
obj.save()

-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 :) It was as simple as creating a QueryDict and sending it
in. Thanks for the suggestions!

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 = json.loads(request.POST['some_json_field'])
q = QueryDict('')
q = q.copy()
q.update(json_object)
form = MyModelForm(q)

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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.

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.

-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 information and a type field in the
AUTH_PROFILE_MODULE model.
So:
AUTH_PROFILE_MODULE = app.Shared
class Shared(models.Model)
type = 'client_profile'
birth_date = ...
# more shared fields

class ClientProfile(models.Model)
shared = models.OneToOneField(Shared, related_name='client_profile')

then you can do:
shared_profile = User.get_profile()
client_profile = shared_profile.client_profile

Or even dynamically, if you make sure shared.type matches extended's
related_name:
shared_profile = User.get_profile()
extended_profile = getattr(shared_profile, shared_profile.type)

-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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, Melvyn Sopacua wrote:
>
> 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 should be used for 'change forms' and request.POST for 
> the /result/ of that form. 
> -- 
> Melvyn Sopacua 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/rmrcIohRghEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 should be used for 'change forms' and request.POST for
the /result/ of that form.
-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 they stored somewhere else?
> 
> No, but you need the localize filter or tag:
> 

Wait, if this is the same data from the model, then you need to change
the DATE_FORMAT. DATE_INPUT_FORMAT is for form fields, since the form
field needs to be able to change it back to a format that python's
datetime.date will understand. DATE_FORMAT is used for plain output.

-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 localize filter or tag:



-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/P9cRUv1oD5IJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 chances
To hear You call my name

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 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 Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Marcin Tustin
Tel: 07773 787 105

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 reading for days, I'm still lost on how 
to make it happen?


Thanks!
Nick_B 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/nmolpH9zKwAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 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 wrote:
>>
>> Since I don't see anything wrong with your code or setup, I'm going to
>> take a stab in the dark and say that you need to loose the underscore in
>> the command.
>>
>
> Toodle-looo
> creedcode
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/IyKV_xgNgOcJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 wrote: 
>
> Since I don't see anything wrong with your code or setup, I'm going to 
> take a stab in the dark and say that you need to loose the underscore in 
> the command.
>

Toodle-looo
creedcode 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/IyKV_xgNgOcJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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: '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.
>>
>> Instead of:
>> from django.db import models
>> use:
>> from django.contrib.gis.db import models
>
> Strike that, your actual problem is that your settings.py does not
> contain the correct gis enabled backend.
> Still, getting the tutorial to work is key. ;)

Thanks, Melvyn for your kind help. Yes, you are right, my settings.py
file does not contain the correct gis enabled backend. As i am working
on mysql database, so i include following line to the DATABASE engine,

'ENGINE': 'django.contrib.gis.db.backends.mysql',

And then the syncdb command successfully worked.

-- 
Satinderpal Singh
http://satindergoraya.blogspot.in/

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 manage.py syncdb? Here must be a 
> problem :)
>
>
> суббота, 4 августа 2012 г., 8:59:34 UTC+3 пользователь Will 
> Tuladhar-Douglas написал:
>>
>> Folks,
>>
>> I just checked and I'm running Postgres 9.1 and Postgis 2.0SVN with 
>> GeoDjango (on Mac OSX 10.7.4) . I'm not doing anything very exciting with 
>> GeoDjango so far, so perhaps there are problems I haven't encountered, but 
>> it does run, and it is possible to encode locations using the GeoDjango ORM 
>> features. I didn't do anything special for Django (1.4.1) or GeoDjango, but 
>> setting up PostGis does need to be done right, and the special version of 
>> psycopgsl is required - all of that is well documented, though.
>>
>> -WBTD.
>>
>>
>>
>> On 4 Aug 2012, at 04:24, Oleg Korsak wrote:
>>
>> looks like GeoDjango is dead, it is not solved for almost half of the year
>>
>> четверг, 19 июля 2012 г., 21:23:03 UTC+3 пользователь Dominique Guardiola 
>> Falco написал:
>>>
>>>
>>> Is there a tutorial describing how to do this somewhere please ?
>>> Because right now, geodjango is unusable with PostGreSQL 9 + PostGIS 2
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/mmBsv7nuDvoJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>>
>>
>> - - -- --- -  -
>> Will Tuladhar-Douglas 
>> Anthropology ∙ Environments ∙ Religions
>> Wellcome Trust  Research Fellow, Nepal, 
>> 2011-12.
>> Visiting Scientist, ICIMOD  SL/PR group.
>> tending.to/garden
>>  
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Xd_it9vgmQYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 (and
possibly edit depending on permissions).

A group will have its own url, showing the posts of that group.

Groups can be public or private. Public groups are partly visible to
non-members. Private groups are not visible to non-members.

A User will have a page showing all activity from all the groups they're
members of.

A User may be an administrator of one group, but only a regular member
of another group.

So anyway, I'm having a hard time trying to filter these requirements
through the two available packages I've found, django-groups
(https://github.com/brosner/django-groups) and django-organizations
(https://github.com/bennylope/django-organizations/).

Does anyone have any experience with them or can anyone offer any advice
about which one matches the requirements best? Neither seem to be listed
on django-packages.

Cheers,

Paul

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 I have overridden it like '%I:%M %p', and it works 11:15 PM within 
the forms.


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?




On 13/08/12 15:30, Melvyn Sopacua wrote:

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
recognized

django/conf/locale/en_GB/ exists.
The internationalization modules first look for specific then for the
less specific match if it doesn't exist.


--
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 comment that it was
experimental... 

http://askbot.org/doc/sending-email-to-askbot.html

Maybe that could be spun out into it's own app.

Paul

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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
> recognized

django/conf/locale/en_GB/ exists.
The internationalization modules first look for specific then for the
less specific match if it doesn't exist.
-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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. Thanks for the link, yes I could 
override DATETIME_INPUT_FORMATS within a custom-formats.py


mysite/
formats/
__init__.py
en/
__init__.py
formats.py


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 
recognized





On 13/08/12 14:49, Melvyn Sopacua wrote:

from django.utils.translation import activate
activate('en-us')
print form

...

...

activate('nl_NL')
print form

...

...

The reason is in django/conf/locale/en/formats.py. Localize uses the
first *_INPUT format available, which happens to be:
DATE_INPUT_FORMATS = (
 '%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006',
'10/25/06'

So if you want a different input format, you'll need to override this as
described at:



--
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 javascript to send the data back, or use javascript to
create your UI, and process the data with a hand-written view.

On Mon, Aug 13, 2012 at 10:04 AM, Tim  wrote:

> 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
> supposed to be.
>
> After reading about modelforms and now looking at tastypie, I wonder how
> and why one picks one over the other. It seems to me that using tastypie
> and some jquery editable tables will abstract away the work of putting the
> data from the user in all the right places, while doing the logic with
> modelforms means I'll do it myself in the view/save logic.
>
> I'm just learning this part and wonder what others have to say. Is the
> tastypie/api method good for complex relationships and modelforms should be
> used for simpler ones? I guess that you can accomplish the same work with
> either method.
>
> thanks,
> --Tim Arnold
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/WHI1eJWMV2AJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Marcin Tustin
Tel: 07773 787 105

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 
supposed to be.

After reading about modelforms and now looking at tastypie, I wonder how 
and why one picks one over the other. It seems to me that using tastypie 
and some jquery editable tables will abstract away the work of putting the 
data from the user in all the right places, while doing the logic with 
modelforms means I'll do it myself in the view/save logic.

I'm just learning this part and wonder what others have to say. Is the 
tastypie/api method good for complex relationships and modelforms should be 
used for simpler ones? I guess that you can accomplish the same work with 
either method.

thanks,
--Tim Arnold

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/WHI1eJWMV2AJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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:

https://code.djangoproject.com/ticket/17566

Vitalije

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/YoiAPVK_7ZoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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.


|MIDDLEWARE_CLASSES=  (
...
'django.middleware.locale.LocaleMiddleware',
)
|


So from then on the Americans can see their date in their format and 
Europeans in theirs.
If I hardcoded the format like this though, this would break it for one 
or the other group.  Django has to do it through the culture automatically.


I don't understand, it works for templates, inputformat for forms works 
as well, only the form-output is not working. So weird...I really am 
curios how the American Django users have setup their date fields in the 
ModelForm. :)   I think I have to wait til later today so they wake up 
and see the emails. :))


Thank you,
Houman


On 13/08/12 14:46, Carlos Palol wrote:

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 Meta:
model = Conversation

This combination of attributes input_formats and localize should make 
this field to use the m/d/y format for forms (always), while printing 
the value in the localized way (Aug. 31, 2012).


Cheers


On Monday, 13 August 2012 14:47:57 UTC+2, 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` first.

Nonetheless neither version works.

Any other idea? :(


On 13/08/12 13:20, Melvyn Sopacua wrote:
> def formfield_callback(field, **kwargs) :
> return field.formfield(localize=True, **kwargs)

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/7MlUvieqzRUJ.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


--
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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` first.
> 
> Nonetheless neither version works.

It works, but it's not visible:
>>> from one.models import Person, localize_field
>>> from django.forms.models import modelform_factory
>>> FormClass = modelform_factory(Person, formfield_callback=localize_field)
>>> form = FormClass()
>>> form.fields['registered'].localize
True
>>> from django.utils.translation import activate
>>> activate('en-us')
>>> print form
...

...
>>> activate('nl_NL')
>>> print form
...

...

The reason is in django/conf/locale/en/formats.py. Localize uses the
first *_INPUT format available, which happens to be:
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006',
'10/25/06'

So if you want a different input format, you'll need to override this as
described at:

-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 Meta:
model = Conversation

This combination of attributes input_formats and localize should make this 
field to use the m/d/y format for forms (always), while printing the value 
in the localized way (Aug. 31, 2012).

Cheers


On Monday, 13 August 2012 14:47:57 UTC+2, 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` first. 
>
> Nonetheless neither version works. 
>
> Any other idea? :( 
>
>
> On 13/08/12 13:20, Melvyn Sopacua wrote: 
> > def formfield_callback(field, **kwargs) : 
> > return field.formfield(localize=True, **kwargs) 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/7MlUvieqzRUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 other idea? :(


On 13/08/12 13:20, Melvyn Sopacua wrote:

def formfield_callback(field, **kwargs) :
return field.formfield(localize=True, **kwargs)


--
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 library and import it to my model.py file. Any
>> help will be appreciated, thanks in advance.
> 
> Instead of:
> from django.db import models
> use:
> from django.contrib.gis.db import models

Strike that, your actual problem is that your settings.py does not
contain the correct gis enabled backend.
Still, getting the tutorial to work is key. ;)

-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 will be appreciated, thanks in advance.

Instead of:
from django.db import models
use:
from django.contrib.gis.db import models

The gis docs are very informative, try to get the tutorial working first.

-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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:
> 
> 
> 
> Memcached error: shops_categories.get_count.5942 -> {'version': None,
> 
> 'value': 1328, 'key': 'shops_categories.get_count.5935', 'vkey':
> 
> None}
> 
> 
> 
> As shown above requested key was
> 
> shops_categories.get_available_items_count.5942 and fetched value is
> 
> wrong, key for given value is
> 
> shops_categories.get_available_items_count.5935. Strange. This log is
> 
> generated by custom method 'get', which contains no magic, its just a
> 
> wrapper over django.core.cache.cache.get to log a key that was asked
> 
> for and value that django.core.cache.cache.get fetched.
> 
> 
> 
> There are some clues about this strange behaviour:
> 
> 
> 
> - problem seems to be related to start/stop of the fcgi child process.
> 
> When testing with 'ab -n 1000 -c 10' and runfcgi maxchildren=5 and
> 
> maxrequests parameter set to 10 those errors are visible and almost
> 
> constant, but set maxrequests to, let`s say, 100 000 and there are
> 
> none of them.
> 
> 
> 
> - most of the time mixed up values are similar, but this is not a
> 
> rule. For instance:
> 
> 
> 
> 11-02-11 09:50 aktywni.cache.utilsERRORutils:  23
> 
> Memcached error: shops_categories.get_category_descendants.5650 ->
> 
> {'version': None, 'value': 122, 'key':
> 
> 'shops_categories.get_available_items_count.5650', 'vkey': None}
> 
> 
> 
> 11-02-11 09:50 aktywni.cache.utilsERRORutils:  23
> 
> Memcached error: shops_categories.get_available_items_count.5650 ->
> 
> {'version': None, 'value': 1328, 'key':
> 
> 'shops_categories.get_available_items_count.5935', 'vkey': None}
> 
> 
> 
> 11-02-11 09:50 aktywni.cache.utilsERRORutils:  23
> 
> Memcached error: shops_categories.get_category_descendants.5948 ->
> 
> {'version': None, 'value': 0, 'key':
> 
> 'shops_categories.get_available_items_count.5795', 'vkey': None}
> 
> 
> 
> - single view generates around 25-50 cache requests, or even more.
> 
> 
> 
> - when using get_multi tracebacks looks like this one:
> 
> 
> 
>  File "/var/www/htdocs/serwisy/aktywni.pl/lib/django/core/cache/
> 
> backends/memcached.py", line 60, in get_many
> 
>return self._cache.get_multi(map(smart_str,keys))
> 
> 
> 
>  File "/var/www/htdocs/serwisy/aktywni.pl/lib/memcache.py", line 738,
> 
> in get_multi
> 
>retvals[prefixed_to_orig_key[rkey]] = val   # un-prefix returned
> 
> key.
> 
> 
> 
> KeyError: 'shops_categories.get_lowest_categories'
> 
> 
> 
> - I`ve tested my site on threaded fcgi, and there is no such problem
> 
> in
> 
> 
> 
> Maybe there is some problem with connection to memcached left open
> 
> after fcgi process is killed after set amount of requests? Maybe for
> 
> some reason another request from next process is getting values from
> 
> the already killed one? Of course there is no evidence of failure in
> 
> memcached logs in verbose mode.
> 
> 
> 
> Feel free to ask more questions, this is my first apperance on this
> 
> group, I`ve tried to show every piece of evidence : )
> 
> 
> 
> Env summary:
> 
> Ubuntu 10.10 minimal (but there was the same problem on Gentoo)
> 
> memcached 1.4.5
> 
> python-memcached 1.43
> 
> django 1.2.1
> 
> nginx 0.7.67

Hello! So did you find the solution of this problem?
I have the same problem and it would be great if there is a real solutions.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/uuOIOMHDLN0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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. If you're using a ModelForm the not so obvious way is to provide
a formfield_callback to the ModelForm construction, which looks
something like this:

def formfield_callback(field, **kwargs) :
return field.formfield(localize=True, **kwargs)

Looking at django.forms.models.modelform_factory will shed some light on
this.
And of course:

-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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
> signingand to
> put a signed value contained the user details and record they are
> approving or reject by email. That way I don't have to rely on the SMTP
> headers. There is also the added benefit of being able to use the
> TimestampSigner class so that messages could expire after a certain period
> if the user didn't respond to them.

That's a good idea actually. Your only problem will be the security of
the user's email account and while that has been proven less secure then
one would expect, it makes identity theft the user's problem.

-- 
Melvyn Sopacua

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 Singh
http://satindergoraya.blogspot.in/

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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  wrote:

> 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 with Jenkins!!
>
> This is the following error Jenkins Console output is showing:
>
> So, can you help me fixing it!!
>
> *Started by user Jenkins System Builder*
>
> *Building remotely on pingbldr in workspace 
> pingbldr/ci/jenkins/workspace/ping-build*
>
> *Checkout:pingmee-build / pingmeebldr/ci/jenkins/workspace/pingmee-build - 
> hudson.remoting.Channel@b45831:pingbldr*
>
> *Using strategy: Default*
>
> *Checkout:pingmee-build / pingbldr/ci/jenkins/workspace/pingmee-build - 
> hun.remoting.Locnel@3976*
>
> *Cloning the remote Git repository*
>
> *Cloning repository origin*
>
> *Fetching upstream changes from MY SSH*
>
> *Seen branch in repository origin/HEAD*
>
> *Seen branch in repository origin/master*
>
> *Commencing build of Revision (EDIT ***) (origin/HEAD, origin/master)*
>
> *Checking out Revision (EDIT ) (origin/HEAD, origin/master)*
>
> *No change to record in branch origin/HEAD*
>
> *No change to record in branch origin/master*
>
> *[pingmee-build] $ /bin/sh -xe /tmp/huon62.sh*
>
> *+ alias 'rsync=rsync --delete-after -az -e 
> '\''/usr/libexec/stickshift/cartridges/jenkins-1.4/info/bin/git_ssh_wrapper.sh'\'''*
>
> *+ . ci_build.sh*
>
> *++ set +x*
>
> *Running .openshift/action_hooks/pre_build*
>
> *Running .openshift/action_hooks/build*
>
> */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*
>
> *Build step 'Execute shell' marked build as failure*
>
> *Archiving artifacts*
>
> *Finished: FAILURE*
>
> * code is edited in some areas for security reasons.
>
>
> On Monday, August 13, 2012 9:37:51 AM UTC+5:30, Nathan Xue wrote:
>
>> http://peng-fei-xue.blogspot.**com/2012/06/howto-create-**
>> django-application-in.html
>>
>> check this post
>>
>> --
>> Sincerely,
>> Pengfei Xue
>>
>>
>>
>>
>>
>> 已使用 Sparrow 
>>
>> 已使用 Sparrow 
>>
>> 在 2012年8月12日星期日,下午7:54,surya 写道:
>>
>> I am really fed up with tutorials on web telling how to configure Django
>> & Python 2.7 on OpenShift  DIY.
>>
>> So, can write a detailed step-by-step procedure on *how to setup Django
>> 1.4 with Python 2.7 on OpenShift using VirtualEnv*??
>>
>> Thanks a lot!!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit https://groups.google.com/d/**
>> msg/django-users/-/gM7OFF1Bx_**kJ
>> .
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to django-users...@**
>> googlegroups.com.
>>
>> For more options, visit this group at http://groups.google.com/**
>> group/django-users?hl=en
>> .
>>
>>
>>   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/RkGxjFu5DWkJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 with Jenkins!!

This is the following error Jenkins Console output is showing:

So, can you help me fixing it!!

*Started by user Jenkins System Builder*

*Building remotely on pingbldr in workspace 
pingbldr/ci/jenkins/workspace/ping-build*

*Checkout:pingmee-build / pingmeebldr/ci/jenkins/workspace/pingmee-build - 
hudson.remoting.Channel@b45831:pingbldr*

*Using strategy: Default*

*Checkout:pingmee-build / pingbldr/ci/jenkins/workspace/pingmee-build - 
hun.remoting.Locnel@3976*

*Cloning the remote Git repository*

*Cloning repository origin*

*Fetching upstream changes from MY SSH*

*Seen branch in repository origin/HEAD*

*Seen branch in repository origin/master*

*Commencing build of Revision (EDIT ***) (origin/HEAD, origin/master)*

*Checking out Revision (EDIT ) (origin/HEAD, origin/master)*

*No change to record in branch origin/HEAD*

*No change to record in branch origin/master*

*[pingmee-build] $ /bin/sh -xe /tmp/huon62.sh*

*+ alias 'rsync=rsync --delete-after -az -e 
'\''/usr/libexec/stickshift/cartridges/jenkins-1.4/info/bin/git_ssh_wrapper.sh'\'''*

*+ . ci_build.sh*

*++ set +x*

*Running .openshift/action_hooks/pre_build*

*Running .openshift/action_hooks/build*

*/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*

*Build step 'Execute shell' marked build as failure*

*Archiving artifacts*

*Finished: FAILURE*

* code is edited in some areas for security reasons. 
 

On Monday, August 13, 2012 9:37:51 AM UTC+5:30, Nathan Xue wrote:
>
>
> http://peng-fei-xue.blogspot.com/2012/06/howto-create-django-application-in.html
>
> check this post
>
> -- 
> Sincerely,
> Pengfei Xue
>
>
>
>
>
> 已使用 Sparrow 
>
> 已使用 Sparrow 
>
> 在 2012年8月12日星期日,下午7:54,surya 写道:
>
> I am really fed up with tutorials on web telling how to configure Django & 
> Python 2.7 on OpenShift  DIY.
>
> So, can write a detailed step-by-step procedure on *how to setup Django 
> 1.4 with Python 2.7 on OpenShift using VirtualEnv*??
>
> Thanks a lot!!
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/gM7OFF1Bx_kJ.
> To post to this group, send email to django...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> django-users...@googlegroups.com .
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>  
>  
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/RkGxjFu5DWkJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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
object) and objects are created from that data.

At the moment this command is listed as a cron job, so the mailbox is
polled for mail every x minutes, but I'm sure it could be setup so that
the mail server calls the script when it gets mail.

But it's not stand-alone and the security issues around spoof mails
described by Melvyn Sopacua are not resolved.

I like the idea of "secret email addresses". I think this is what
spamcop.net does.

Paul


-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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. Clever.


Now that the date input is accepted in American dateformat.
Within the template I get // 
 Aug. 31, 2012, which is 
also correct.

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?


How do you guys in US do that?

Thanks,





On 13/08/12 10:48, Houmie wrote:


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'
LANGUAGE_CODE=  'en-us'
USE_I18N=  True
USE_L10N=  True
USE_TZ=  True

|

*ModelForm:*

|class  CallsForm(ModelForm): 
class  Meta:
 model=  Conversation
 widgets=  {

 'contact_date':  forms.DateInput(attrs={'placeholder':  
'Add the date...',  'id':  'datepicker',  'class':  'placeholder_fix_css'},  
format='%m/%d/%Y'),
}
|

enter image description here

Any idea why the American Dateformat still isn't accepted?

Many Thanks,
Houman

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/uuMUxpVhbx4J.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


--
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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?
>>
>
> 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 showed my how to select the language on a requests basis, then
> the problem should basically be solved and I should be able to solv ethe
> rest by myself.
>
>
> It may be, that there is an obvious mentioning in the documentation.
> However I fail to see it. Thus my question.
>
>
> What I'd like to achieve is to be able to have the language settings on a
> user by user basis.
>
> I assume, that this can be achieved via some middleware and some state
> variable, that I had to link to a user.
> I did not find the related documention and wanted to know if anybody can
> point me to the right doc (or section of the doc)
>
> The link you refer to is exactly one page and somehow I miss to see any
> outgoing links to more specialized topics.
> I know, that I rad already more docs about I18n for django, but don't
> remember the chapter / link name.
>
> In fact the link doesn't even mention, that changing
> settings.LANGUAGE_CODE allows to change the language site wise.
> So there must be some other doc explaining more.
>
>
>
>> On Sun, Aug 12, 2012 at 6:52 PM, Gelonida N > > wrote:
>>
>> On 08/12/2012 08:46 PM, Marcin Tustin wrote:
>>
>> This is linked from the Django front page:
>> https://docs.djangoproject.__**com/en/1.4/topics/i18n/
>> 
>> 
>> >
>>
>> Come back with specific questions when you get stuck.
>>
>>
>>
>> Thanks for your answer.
>>
>> I created already all the l18n messages and I can switch the
>> language site wise  by changing the language in settings.py
>>
>> However Now I'd like to change them via user preferences. (not
>> cookies)
>> (So if one user changes the language on one m,achine it should be
>> changed on any other machine if he logs in.
>>
>> I'd prefer not to set the language as suggested by the browser, but
>> let the user the choice even if his useragent suggests another
>> prefered language.
>>
>>
>> There seems to be a url based approach and a cookies based approach
>> I wonder what would be best for my scenario.
>> (I am in full control of the web server and can add redirects /
>> rewrite rules, etc. if this helps)
>>
>>
>> This might be explained somewhere in more details in the Django
>> docss however I did not find the related page.
>>
>> The doc mentions:
>> "It uses these hooks to localize Web apps for particular users
>> according to their preferences."
>>
>> but I did not find the how
>>
>>
>>
>> On Sun, Aug 12, 2012 at 1:10 PM, Gelonida N > 
>> >> wrote:
>>
>>
>>  I'd like to have a web site, where the can switch the
>> language
>>  The first time the user connects the language would be the
>> prefered
>>  language as sugegsted by the news agent,
>>  then the user could select the prefered lanngauge in some
>> user
>>  preference settings.
>>
>>
>>
>>  What would be the standard way to do this in Django?
>>
>>  Thanks in advance for comments,  examples, snippets, links,
>>
>>  --
>>  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 > googlegroups.com >
>>  
>> 
>> 
>> 
>> >>.
>>
>>  To unsubscribe from this group, send email to
>>  
>> django-users+unsubscribe@__goo**__glegroups.com
>> 
>>  
>> 
>> 
>> 
>> >__>.
>>
>>  For more options, visit this group at
>> 
>> http://groups.google.com/**group/django-users?hl=en
>> 
>> 

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 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
objects. That way I don't need to write new forms every-time, the code
will auto generate HTML and i want to embbeded it in to Django-Framwork.
>
> So,
>
> How can execute perl scripts in Django framework,so that I
can accomplish this function.
>
> Thank You
>  Pervez
>
> --
> 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 group, send email to
django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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'
LANGUAGE_CODE = 'en-us'
USE_I18N = True
USE_L10N = True
USE_TZ = True

*ModelForm:*

class CallsForm(ModelForm):
   class Meta:
model = Conversation   
widgets = {
'contact_date': forms.DateInput(attrs={'placeholder': 'Add 
the date...', 'id': 'datepicker', 'class': 'placeholder_fix_css'}, 
format='%m/%d/%Y'),
   }

[image: enter image description here]

Any idea why the American Dateformat still isn't accepted?

Many Thanks,
Houman

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/uuMUxpVhbx4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 objects.
That way I don't need to write new forms every-time, the code will auto
generate HTML and i want to embbeded it in to Django-Framwork.

So,

How can execute perl scripts in Django framework,so that I
can accomplish this function.

Thank You
 Pervez

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 obvious, so apologies for the 
unclarity.

JB

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/kgMJfzZiaIIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 
> on an intranet site (CentOS6) that is also connected to windows AD. My aim 
> is to add users in the default Django model, but have django do password 
> verification against the local system (I guess that means PAM). This way 
> users only need to change their password once, and locked-out users from AD 
> are auto-disabled from the django-site. Additional bonus would be if Django 
> understands the AD groups.
> I know there is an LDAP backend for django but I just cannot manage to get 
> it to work against windows 2003 AD. Being able to auth against local user 
> (and have the OS/samba deal with the AD integration) would be much easier. 
> Does anyone have any pointers?
>
> many thanks
> 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/I93DdPnylJkJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 AD. My aim 
is to add users in the default Django model, but have django do password 
verification against the local system (I guess that means PAM). This way 
users only need to change their password once, and locked-out users from AD 
are auto-disabled from the django-site. Additional bonus would be if Django 
understands the AD groups.
I know there is an LDAP backend for django but I just cannot manage to get 
it to work against windows 2003 AD. Being able to auth against local user 
(and have the OS/samba deal with the AD integration) would be much easier. 
Does anyone have any pointers?

many thanks
joris

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/EiybzBmNEWEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 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 showed my how to select the language on a requests basis,
> then the problem should basically be solved and I should be able to solv
> ethe rest by myself.
>
>
> It may be, that there is an obvious mentioning in the documentation.
> However I fail to see it. Thus my question.
>
>
> What I'd like to achieve is to be able to have the language settings on
> a user by user basis.
>
> I assume, that this can be achieved via some middleware and some state
> variable, that I had to link to a user.
> I did not find the related documention and wanted to know if anybody can
> point me to the right doc (or section of the doc)
>
> The link you refer to is exactly one page and somehow I miss to see any
> outgoing links to more specialized topics.
> I know, that I rad already more docs about I18n for django, but don't
> remember the chapter / link name.
>
> In fact the link doesn't even mention, that changing
> settings.LANGUAGE_CODE allows to change the language site wise.
> So there must be some other doc explaining more.
>
>
>>
>> On Sun, Aug 12, 2012 at 6:52 PM, Gelonida N > > wrote:
>>
>> On 08/12/2012 08:46 PM, Marcin Tustin wrote:
>>
>> This is linked from the Django front page:
>> https://docs.djangoproject.__com/en/1.4/topics/i18n/
>> 
>>
>> Come back with specific questions when you get stuck.
>>
>>
>>
>> Thanks for your answer.
>>
>> I created already all the l18n messages and I can switch the
>> language site wise  by changing the language in settings.py
>>
>> However Now I'd like to change them via user preferences. (not
>> cookies)
>> (So if one user changes the language on one m,achine it should be
>> changed on any other machine if he logs in.
>>
>> I'd prefer not to set the language as suggested by the browser, but
>> let the user the choice even if his useragent suggests another
>> prefered language.
>>
>>
>> There seems to be a url based approach and a cookies based approach
>> I wonder what would be best for my scenario.
>> (I am in full control of the web server and can add redirects /
>> rewrite rules, etc. if this helps)
>>
>>
>> This might be explained somewhere in more details in the Django
>> docss however I did not find the related page.
>>
>> The doc mentions:
>> "It uses these hooks to localize Web apps for particular users
>> according to their preferences."
>>
>> but I did not find the how
>>
>>
>>
>> On Sun, Aug 12, 2012 at 1:10 PM, Gelonida N > 
>> >> wrote:
>>
>>
>>  I'd like to have a web site, where the can switch the
>> language
>>  The first time the user connects the language would be the
>> prefered
>>  language as sugegsted by the news agent,
>>  then the user could select the prefered lanngauge in some
>> user
>>  preference settings.
>>
>>
>>
>>  What would be the standard way to do this in Django?
>>
>>  Thanks in advance for comments,  examples, snippets, links,
>>
>>  --
>>  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 group, send email to
>>  django-users+unsubscribe@__goo__glegroups.com
>> 
>>  > __>.
>>
>>  For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en
>> 
>>  > >.
>>
>>
>>
>>
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105 
>>
>> --
>> You received this message because you are subscribed to the
>> Google
>> Groups 

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 that one out.


On 08/13/2012 12:54 AM, Marcin Tustin wrote:

So, what part, exactly is a problem? What have you tried?

On Sun, Aug 12, 2012 at 6:52 PM, Gelonida N > wrote:

On 08/12/2012 08:46 PM, Marcin Tustin wrote:

This is linked from the Django front page:
https://docs.djangoproject.__com/en/1.4/topics/i18n/


Come back with specific questions when you get stuck.



Thanks for your answer.

I created already all the l18n messages and I can switch the
language site wise  by changing the language in settings.py

However Now I'd like to change them via user preferences. (not cookies)
(So if one user changes the language on one m,achine it should be
changed on any other machine if he logs in.

I'd prefer not to set the language as suggested by the browser, but
let the user the choice even if his useragent suggests another
prefered language.


There seems to be a url based approach and a cookies based approach
I wonder what would be best for my scenario.
(I am in full control of the web server and can add redirects /
rewrite rules, etc. if this helps)


This might be explained somewhere in more details in the Django
docss however I did not find the related page.

The doc mentions:
"It uses these hooks to localize Web apps for particular users
according to their preferences."

but I did not find the how



On Sun, Aug 12, 2012 at 1:10 PM, Gelonida N 
>> wrote:


 I'd like to have a web site, where the can switch the language
 The first time the user connects the language would be the
prefered
 language as sugegsted by the news agent,
 then the user could select the prefered lanngauge in some user
 preference settings.



 What would be the standard way to do this in Django?

 Thanks in advance for comments,  examples, snippets, links,

 --
 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 group, send email to
 django-users+unsubscribe@__goo__glegroups.com

 __>.

 For more options, visit this group at
http://groups.google.com/group/django-users?hl=en

 >.





--
Marcin Tustin
Tel: 07773 787 105 

--
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 group, send email to
django-users+unsubscribe@__googlegroups.com
.
For more options, visit this group at
http://groups.google.com/__group/django-users?hl=en
.



--
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 group, send email to
django-users+unsubscribe@__googlegroups.com
.
For more options, visit this group at
http://groups.google.com/__group/django-users?hl=en
.




--
Marcin Tustin
Tel: 07773 787 105

--
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 group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, 

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 has already been set in the user's session or
browser cookie. If yes, let internalisation work as usual else, check
the 'preferred_language' from the user's profile and store it in the
session or browser cookie and let internalization work as usual.

I hope that gives you some ideas and if you like the idea and run into
problems, you would be able to get a lot of helpful answers from the
group

On 8/12/12, Gelonida N  wrote:
> On 08/12/2012 08:46 PM, Marcin Tustin wrote:
>> This is linked from the Django front page:
>> https://docs.djangoproject.com/en/1.4/topics/i18n/
>>
>> Come back with specific questions when you get stuck.
>
>
> Thanks for your answer.
>
> I created already all the l18n messages and I can switch the language
> site wise  by changing the language in settings.py
>
> However Now I'd like to change them via user preferences. (not cookies)
> (So if one user changes the language on one m,achine it should be
> changed on any other machine if he logs in.
>
> I'd prefer not to set the language as suggested by the browser, but let
> the user the choice even if his useragent suggests another prefered
> language.
>
>
> There seems to be a url based approach and a cookies based approach I
> wonder what would be best for my scenario.
> (I am in full control of the web server and can add redirects / rewrite
> rules, etc. if this helps)
>
>
> This might be explained somewhere in more details in the Django docss
> however I did not find the related page.
>
> The doc mentions:
> "It uses these hooks to localize Web apps for particular users according
> to their preferences."
>
> but I did not find the how
>
>
>>
>> On Sun, Aug 12, 2012 at 1:10 PM, Gelonida N > > wrote:
>>
>>
>> I'd like to have a web site, where the can switch the language
>> The first time the user connects the language would be the prefered
>> language as sugegsted by the news agent,
>> then the user could select the prefered lanngauge in some user
>> preference settings.
>>
>>
>>
>> What would be the standard way to do this in Django?
>>
>> Thanks in advance for comments,  examples, snippets, links,
>>
>> --
>> 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 group, send email to
>> django-users+unsubscribe@__googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/__group/django-users?hl=en
>> .
>>
>>
>>
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105
>>
>> --
>> 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 group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>
>
> --
> 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 group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
Sent from my mobile device

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 showed my how to select the language on a requests basis, 
then the problem should basically be solved and I should be able to solv 
ethe rest by myself.



It may be, that there is an obvious mentioning in the documentation.
However I fail to see it. Thus my question.


What I'd like to achieve is to be able to have the language settings on 
a user by user basis.


I assume, that this can be achieved via some middleware and some state 
variable, that I had to link to a user.
I did not find the related documention and wanted to know if anybody can 
point me to the right doc (or section of the doc)


The link you refer to is exactly one page and somehow I miss to see any 
outgoing links to more specialized topics.
I know, that I rad already more docs about I18n for django, but don't 
remember the chapter / link name.


In fact the link doesn't even mention, that changing 
settings.LANGUAGE_CODE allows to change the language site wise.

So there must be some other doc explaining more.




On Sun, Aug 12, 2012 at 6:52 PM, Gelonida N > wrote:

On 08/12/2012 08:46 PM, Marcin Tustin wrote:

This is linked from the Django front page:
https://docs.djangoproject.__com/en/1.4/topics/i18n/


Come back with specific questions when you get stuck.



Thanks for your answer.

I created already all the l18n messages and I can switch the
language site wise  by changing the language in settings.py

However Now I'd like to change them via user preferences. (not cookies)
(So if one user changes the language on one m,achine it should be
changed on any other machine if he logs in.

I'd prefer not to set the language as suggested by the browser, but
let the user the choice even if his useragent suggests another
prefered language.


There seems to be a url based approach and a cookies based approach
I wonder what would be best for my scenario.
(I am in full control of the web server and can add redirects /
rewrite rules, etc. if this helps)


This might be explained somewhere in more details in the Django
docss however I did not find the related page.

The doc mentions:
"It uses these hooks to localize Web apps for particular users
according to their preferences."

but I did not find the how



On Sun, Aug 12, 2012 at 1:10 PM, Gelonida N 
>> wrote:


 I'd like to have a web site, where the can switch the language
 The first time the user connects the language would be the
prefered
 language as sugegsted by the news agent,
 then the user could select the prefered lanngauge in some user
 preference settings.



 What would be the standard way to do this in Django?

 Thanks in advance for comments,  examples, snippets, links,

 --
 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 group, send email to
 django-users+unsubscribe@__goo__glegroups.com

 __>.

 For more options, visit this group at
http://groups.google.com/group/django-users?hl=en

 >.





--
Marcin Tustin
Tel: 07773 787 105 

--
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 group, send email to
django-users+unsubscribe@__googlegroups.com
.
For more options, visit this group at
http://groups.google.com/__group/django-users?hl=en

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.

However, I'm pleased to see there are several options to choose from
without any extra add-on required as with PHP CMS-es (WP, Concrete5).


Sincerely,
Gour

-- 
As fire is covered by smoke, as a mirror is covered by dust, 
or as the embryo is covered by the womb, the living entity is 
similarly covered by different degrees of this lust.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


signature.asc
Description: PGP signature