Re: Problem With Templatetags

2011-07-28 Thread nicolas HERSOG
Did you create an empty file __init__.pyc in your tag folder ?

On Thu, Jul 28, 2011 at 8:51 AM, Showket Bhat wrote:

> Thanks For ur Assistance.. But That Dosen't Helped me... Need Some
> Other Solution..
>
> --
> 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: Problem With Templatetags

2011-07-28 Thread nicolas HERSOG
In my tag folder i have __init__.py __init__.pyc myTag.py et myTag.pyc which
is empty

On Thu, Jul 28, 2011 at 9:02 AM, nicolas HERSOG  wrote:

> Did you create an empty file __init__.pyc in your tag folder ?
>
>
> On Thu, Jul 28, 2011 at 8:51 AM, Showket Bhat 
> wrote:
>
>> Thanks For ur Assistance.. But That Dosen't Helped me... Need Some
>> Other Solution..
>>
>> --
>> 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: Problem With Templatetags

2011-07-28 Thread Showket Bhat
yes I have done that..Do i need to put anything in settings.py

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



Error Please Help

2011-07-28 Thread Showket Bhat
Hi All,

I am using templatetags to create one tag.. I created the folder
templatetags and created 2 files in it.. __init__.py which is empty
and another temp_tags.py.. where i put one method

temp_tags.py

from django import template
register = template.Library()
register.filter('lower', lower)

def lower(value): # Only one argument.
#   "Converts a string into all lowercase"
return value.lower()

=
template2.html
=

{% load temp_tags %}

This will print my name in lowercase: {{ name|lower }}



I ve not inserted anything in setting.py regarding templatetags and I
am getting this error

=

TemplateSyntaxError at /view2/

'temp_tags' is not a valid tag library: Template library temp_tags not
found, tried
django.templatetags.temp_tags,django.contrib.admin.templatetags.temp_tags

Request Method: GET
Request URL:http://localhost:8000/view2/
Django Version: 1.3
Exception Type: TemplateSyntaxError
Exception Value:

'temp_tags' is not a valid tag library: Template library temp_tags not
found, tried
django.templatetags.temp_tags,django.contrib.admin.templatetags.temp_tags

Exception Location: /usr/local/lib/python2.6/dist-packages/django/
template/defaulttags.py in load, line 1054
Python Executable:  /usr/bin/python
Python Version: 2.6.4



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



Aw: Re: Problem With Templatetags

2011-07-28 Thread Juergen Schackmann
have you added the application that holds your template tag to settings.py?

-- 
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/-/pgqWMXKi-UsJ.
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: USE_I18N vs. USE_L10N

2011-07-28 Thread Benedict Verheyen
On 28/07/2011 2:28, Lachlan Musicman wrote:
> On Wed, Jul 27, 2011 at 16:53, kenneth gonsalves  
> wrote:
>> On Tue, 2011-07-26 at 15:09 +0100, Tom Evans wrote:
>>> I strongly disagree, i18n and l10n have explicit and well known
>>> technical meanings, dating from the late 80s. It is right and proper
>>> to use those names in django, as they are used in every other project
>>> under the sun.
>>
>> +1
> 
> And mine makes it +2
> 
> 
> 

Just to add my 2 euro cents, I think both opinions have merit to some point but 
in the
end, it's better to leave the technical terms as it forces the programmer to 
search
more info on these topics to know what they mean.

For a person with no experience with translations or internationalization, the 
terms
don't mean a thing and aren't clear at all.
A more technical person will however immediately recognize these names and know 
what
they mean and how they work.

However, you can argue that a programmer needs to check the background info on
translation/internationalization before using it (which they should).
If they do, they'll know the terms i18n and l10n, and that's the whole point.

Cheers,
Benedict

-- 
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: Doesn't render templates any longer

2011-07-28 Thread Benedict Verheyen
On 27/07/2011 23:39, Max Bachl wrote:
> Hi all!
> I've encountered a strange bug today.
> I want to return an HTTP response with this code:
> 
> def main(request):
> t = loader.get_template("main/start.html")
> return HttpResponse(t)
> 
> However, the only result I get is
> 
> 
> 
>   <'>
> and the rest of the html file has gone. The same error occurs with
> every other file as well. I have tried everything.
> 
> Max
> 

Hi Max,

what version of Django are you using?
Are you tracking the development version (trunk)?

Regards,
Benedict

-- 
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: Problem With Templatetags

2011-07-28 Thread bruno desthuilliers
On Jul 28, 8:17 am, Showket Bhat  wrote:
> Hi All,
>
> I am using templatetags to create one tag..

Actually (according to your code snippet) a filter.

> I created the folder
> templatetags and created 2 files in it.. __init__.py which is empty
> and another temp_tags.py.. where i put one method

s/method/function/

> temp_tags.py
> 
> from django import template
> register = template.Library()
> register.filter('lower', lower)
>
> def lower(value): # Only one argument.
> #       "Converts a string into all lowercase"
>         return value.lower()


If this is your exact real code, you should get a NameError on the
third line, where you try to register your filter function before it's
defined.


Also and FWIW, you don't really need such a filter, just use
{{ name.lower }} in your template.

> I ve not inserted anything in setting.py regarding templatetags and I
> am getting this error
>
> =
>
> TemplateSyntaxError at /view2/
>
> 'temp_tags' is not a valid tag library: Template library temp_tags not
> found, tried
> django.templatetags.temp_tags,django.contrib.admin.templatetags.temp_tags

The django app containing your templatetags package needs to be
registered in settings.INSTALLED_APPS.

-- 
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: Problem With Templatetags

2011-07-28 Thread bruno desthuilliers
On Jul 28, 8:39 am, nicolas HERSOG  wrote:
> Hi, I m new in django too but i ll try to help you.

That's nice from you, but you should possibly read the post you're
answering a bit more carefully:

> In your tem_tag.py can you add : @register.simle_tag just before you def you
> tag, just like this :
>
> @register.simle_tag
> def my_tag():
>     return blablabla


The OP is actually defining a template filter, not tag, so
register.simple_tag is not going to 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: Problem With Templatetags

2011-07-28 Thread Showket Bhat

Thanks A Lot, U know I did the same thing as u said and put it in
Installed APP in settings and It Worked..Dats great..U know I somewre
found on net that there is nothing to deal with settings .py and
tags... Dats rediculas.. Anyways thank you

-- 
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: Problem With Templatetags

2011-07-28 Thread bruno desthuilliers


On Jul 28, 9:02 am, nicolas HERSOG  wrote:
> Did you create an empty file __init__.pyc in your tag folder ?

That's actually a __init__.py (*not* .pyc). And yes, the OP did and
explicitely mentionned it.

-- 
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: Problem With Templatetags

2011-07-28 Thread bruno desthuilliers
On Jul 28, 9:03 am, nicolas HERSOG  wrote:
> In my tag folder i have __init__.py __init__.pyc myTag.py et myTag.pyc which
> is empty

Err... is this actually 'myTag.py' or 'temp_tags.py' ?

-- 
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: Error Please Help

2011-07-28 Thread bruno desthuilliers
Please don't post the same question twice or more - this isn't going
to get you more help.

On Jul 28, 9:24 am, Showket Bhat  wrote:
> Hi All,
>
> I am using templatetags to create one tag.. I created the folder
> templatetags and created 2 files in it.. __init__.py which is empty
> and another temp_tags.py.. where i put one method
>
(snip remaining, answered in the "Problem with templatetag" thread)

-- 
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: Admin - change ForeignKey display text

2011-07-28 Thread Uros Trebec
You should take a look at the Django documentation once more,
somewhere around this area:
https://docs.djangoproject.com/en/1.3/ref/models/instances/#django.db.models.Model.__unicode__

--
Uros

On Jul 27, 10:59 pm, galgal  wrote:
> How can I change the display text in select while selecting a field which is
> as ForeignKey? I need to display not only the name of FK, but also name of
> it's parent.
>
> Anybody can give a clue?

-- 
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: Problem With Templatetags

2011-07-28 Thread nicolas HERSOG
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/

It was just an exemple I gave to Showket, and you'r right, we don t need a
__init__.pyc in the templateTag folder.
I tried to help Showket but i m quite too unexperiment for it yet :)

On Thu, Jul 28, 2011 at 10:21 AM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:

> On Jul 28, 9:03 am, nicolas HERSOG  wrote:
> > In my tag folder i have __init__.py __init__.pyc myTag.py et myTag.pyc
> which
> > is empty
>
> Err... is this actually 'myTag.py' or 'temp_tags.py' ?
>
> --
> 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: Extending Reusable App Models

2011-07-28 Thread Benedict Verheyen
On 27/07/2011 23:29, Django Grappelli wrote:
> Hi All,
> I'm working with a reusable Django application which defines a model that I'd 
> like to extend.  I've read through the documentation on model
> inheritance 
>  
> but haven't found what I'm looking for.  I'd like to
> be able to subclass the model so as to add a few fields to it, but I only 
> want to create one table for the model.  Is there any way around this?
> DG
> 
> -- 
> 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.

I'm not sure I understand your question correctly, but I'll try to answer.
Your base class will have something like this:
...
class Meta:
abstract = True

So no table will be made for the base class.

Cheers,
Benedict



-- 
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: Extending the ManyToMany relation, maybe a bad idea

2011-07-28 Thread Tom Evans
On Thu, Jul 28, 2011 at 3:37 AM, Joshua Russo  wrote:
> I keep thinking I'm doing something wrong here. From the lack of responses I
> feel like there is no real good way to handle a group of options with
> additional relational data.

Or alternatively, no-one understood what you were trying to do and
ignored your post until you made enough sense. Like now.

How you proceed depends upon how much customization you need to do.
This situation is calling out for either a model formset on
OrganizationItem, or an inline formset. There is an excellent blog
post on inline formsets here[1].

Cheers

Tom

[1] http://charlesleifer.com/blog/djangos-inlineformsetfactory-and-you/

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



hi guys help with this error, : Error: No module named staticfiles

2011-07-28 Thread Coulson Thabo Kgathi
this error came after i put this : jango.contrib.staticfiles in the
installed apps

i wanted to put a picture in my template so whne runing the server i
got the error

 Error: No module named staticfiles

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



Nested: transaction.commit_on_success and django 1.3

2011-07-28 Thread Gelonida N
Hi,

I have a specific function with an transaction.commit_on_success


@transaction.commit_on_success
def f1():
   with transaction.commit_on_success:
  do_stuff()
  change_model_data_1 . . ,\.



and I have now another function

def f2():
   change_other_model_data()
   f1()


Now I would like to decorate f2() with

@transaction.commit_on_success

My  expected behaviour for my application would be, that the inner
transaction would be ignored in that case and be extended to the outer
transaction.


Are nested decorators supported with  Django 1.3  or should I write a
small wrapper as recommended in

http://djangosnippets.org/snippets/1343/

The suggested snippet is:

def nested_commit_on_success(func):
"""Like commit_on_success, but doesn't commit existing transactions.

This decorator is used to run a function within the scope of a
database transaction, committing the transaction on success and
rolling it back if an exception occurs.

Unlike the standard transaction.commit_on_success decorator, this
version first checks whether a transaction is already active.  If so
then it doesn't perform any commits or rollbacks, leaving that up to
whoever is managing the active transaction.
"""
commit_on_success = transaction.commit_on_success(func)
def _nested_commit_on_success(*args, **kwds):
if transaction.is_managed():
return func(*args,**kwds)
else:
return commit_on_success(*args,**kwds)
return transaction.wraps(func)(_nested_commit_on_success)


I'm asking as this snippet is already 3 years old.

-- 
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: hi guys help with this error, : Error: No module named staticfiles

2011-07-28 Thread Tom Evans
On Thu, Jul 28, 2011 at 10:56 AM, Coulson Thabo Kgathi
 wrote:
> this error came after i put this : jango.contrib.staticfiles in the
> installed apps
>
> i wanted to put a picture in my template so whne runing the server i
> got the error
>
>  Error: No module named staticfiles
>

staticfiles is in django 1.3 - are you running django 1.3?

Cheers

Tom

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



SyntaxError at /view.py

2011-07-28 Thread morning yao
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/view/

Django Version: 1.3
Python Version: 2.7.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'helloe.shiyan']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in
get_response
  101. request.path_info)
File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in
resolve
  250. for pattern in self.url_patterns:
File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in
_get_url_patterns
  279. patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in
_get_urlconf_module
  274. self._urlconf_module =
import_module(self.urlconf_name)
File "C:\Python27\lib\site-packages\django\utils\importlib.py" in
import_module
  35. __import__(name)
File "C:\Python27\Lib\site-packages\django\helloe\..\helloe\urls.py"
in 
  2. from shiyan.views import archive

Exception Type: SyntaxError at /view/
Exception Value: keyword argument repeated (views.py, line 21)
——
view.py
--

if 'MonthSelect' in request.POST and request.POST['MonthSelect']:
month = request.POST['MonthSelect']
logs =
DailyReport.objects.filter(DailyReport_Timestamp__month=int(month.split('-')
[0]),DailyReport_Timestamp__month=int(month.split('-')[1])).order_by("-
DailyReport_Timestamp")
today = month
else:
today = datetime.datetime.now().month
logs =
DailyReport.objects.filter(DailyReport_Timestamp__month=datetime.datetime.now().month,DailyReport_Timestamp__year=datetime.datetime.now().year).order_by("-
DailyReport_Timestamp")



so,where is error?

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



Extending new User form

2011-07-28 Thread Shegoroa
I am having difficulty figuring out how to make an admin when creating
a new user to have an extra field specifying users location.

I found lots of information on how to extend the user profile and i
did so
(source of information)
http://stackoverflow.com/questions/44109/extending-the-user-model-with-custom-fields-in-django

But now I want the admin every time when he is creating a new user for
there to be a new field under Personal Information of a user to have
an extra field for Location of user.
Any 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.



Issues during installation of Django

2011-07-28 Thread Dargoan
Hello,

I'm new at Django. I have some issues installing Django.
After I download Django 1.3 as the website describes, when I launch
"setup.py install" in my command tool (on Windows XP), it does not run
the script, but instead Vim opens it.
I'm totally new in python word either, so it may be a stupid question
but it's quite annoying.

If anyone here can help me on that, it would be great.
Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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.



Extending the User form

2011-07-28 Thread Sheogora
I have extended the User Profile by adding my own field,
how do I change the New user form in the admin, to show the new field?

-- 
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: SyntaxError at /view.py

2011-07-28 Thread Tom Evans
On Thu, Jul 28, 2011 at 12:27 PM, morning yao  wrote:
> DailyReport.objects.filter(DailyReport_Timestamp__month=int(month.split('-')
> [0]),DailyReport_Timestamp__month=int(month.split('-')[1])).order_by("-
> DailyReport_Timestamp")
>
> so,where is error?
>

You can't supply the same argument twice to a method call. On this
line you are supplying DailyReport_Timestamp__month twice.

Cheers

Tom

-- 
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: Issues during installation of Django

2011-07-28 Thread Tom Evans
On Thu, Jul 28, 2011 at 10:06 AM, Dargoan  wrote:
> Hello,
>
> I'm new at Django. I have some issues installing Django.
> After I download Django 1.3 as the website describes, when I launch
> "setup.py install" in my command tool (on Windows XP), it does not run
> the script, but instead Vim opens it.
> I'm totally new in python word either, so it may be a stupid question
> but it's quite annoying.
>
> If anyone here can help me on that, it would be great.
> Thanks.
>

Run 'python setup.py install'. Add python to your path if it is not already.

Cheers

Tom

-- 
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: SyntaxError at /view.py

2011-07-28 Thread kenneth gonsalves
On Thu, 2011-07-28 at 04:27 -0700, morning yao wrote:
> DailyReport.objects.filter(DailyReport_Timestamp__month=int(month.split('-')
> [0]),DailyReport_Timestamp__month=int(month.split('-')[1])).order_by("-
> DailyReport_Timestamp") 

it is here - keyword repeated.

-- 
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: hi guys help with this error, : Error: No module named staticfiles

2011-07-28 Thread Coulson Thabo Kgathi
how can i updadte django i tried and if failed, pliz 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: hi guys help with this error, : Error: No module named staticfiles

2011-07-28 Thread kenneth gonsalves
On Thu, 2011-07-28 at 14:13 +0200, Coulson Thabo Kgathi wrote:
> how can i updadte django i tried and if failed, pliz help

how did you install django? what distro?

-- 
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: Extending the ManyToMany relation, maybe a bad idea

2011-07-28 Thread Joshua Russo
Ya, sorry, I was just getting frustrated because I was taking longer than I 
wanted to implement this. The formset is what I ended up with. The tricky 
part is still that I want a defined list of options in the formset, so I 
can't just make it a model formset. I haven't worked in Django in a while 
and it just takes a little bit to get my mind around what the options really 
are.

-- 
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/-/g0dNryER_WoJ.
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.



Admin model listing custom ordering

2011-07-28 Thread Vinicius Massuchetto
I got a model with a ForeignKey field, and I want the default listing
of this model to be ordered by this field.

I get the correct `qs.query` SQL statement, but for some reason the
admin listing is not following it. This is what I've done so far:

class SomeAdminModel(admin.ModelAdmin):
# ... fields

def queryset(self, request):
qs = super(SomeAdminModel, self).queryset(request)
fk_list = [1,2,7,3,5,6,4]
ordering = 'FIELD(`fk_field_id`, %s)' % ','.join(str(id)
for id in fk_list)
qs = qs.filter(fk_field__in = fk_list).extra(
select = {'ordering': ordering},
order_by = ('ordering',)
)
return qs

What can be preventing this from behave as desired? Do I need to
override anything else?

Thanks in advance.
-- 
Vinicius Massuchetto
http://vinicius.soylocoporti.org.br

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



[gripe] Pain on OSX

2011-07-28 Thread Kolbe
Is it just me, or is it that painful just to get Django running on
OSX?

During development, I had problems with Mysql_db. More or less got
that solved, and been reading postgre is more or less the preferred
choice? Anyway, for most of development, I've been just using sqlite.

Now I have problems with Apache - trying to install mod_wsgi and I
need to first download developer tools to get gcc and etc...

Then there's the problem of a good hosting provider. You'd probably
just want a hosting provider to have the server all ready and all
you'd need to do is upload the files and off you go!

*gripe*

-- 
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 + PyPy = ?

2011-07-28 Thread Bill Freeman
So what happens if you type while pypy-dist/bin is not the current directory.:

   /absolute/path/to/pypy-dist/bin/pypy

Error or no?

If no error, how about, while cd'ed to your django
project (where settings.py and manage.py are:

  /absolute/path/to/pypy-dist/bin/pypy manage.py shell

Error or no?

If no error, how about (presuming bash or sh):

  export PATH=/absolute/path/to/pypy-dist/bin:$PATH
  pypy manage.py shell

(or the equivalent for your shell.)  You could make this
permanent, if it works and you like it, in ~/.bash_profile .

Or if you don't want to change your PATH environment
variable, you could edit manage.py to begin with:

  #!/absolute/path/to/pypy-dist/bin/pypy

Then do:

   chmod +x manage.py

And you can then say:

  manage.py shell

(or syncdb, runserver, whatever).

Or you can make a shell script called, say, manage, that
cd's to your django project directory, and invokes
manage.py with the appropriate pypy, passing on any
command line arguments that the script got, put the
script somewhere on your path, and you can say:

  manage shell

(If you put it somewhere like /usr/local/bin on a multi-user
machine, you may want to choose a better name.)



BTW, I'm not sure, but I don't expect that mod_wsgi would
be willing to run you using pypy.

Bill
On Wed, Jul 27, 2011 at 4:34 PM, Dmitry Pisklov  wrote:
> That's basically the information I'm trying to find. PyPy docs says nothing
> about that, and they doesn't mention any setup process at all - all that I
> need to do according to their site is "unpack and run - and don't touch
> anything!"... And it simply works for simple python stuff... But not for
> django. And I'm pretty sure it's not a django problem - I'm just trying to
> find here someone who tried running django on pypy and succeeded.
>
> --
> 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/-/OY8G3ppuqcgJ.
> 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: [gripe] Pain on OSX

2011-07-28 Thread Shawn Milochik
I've never had a problem with Django on OS X. I have had problems with
psycopg2 due to the default Python that comes with OS X, but if you
recompile Python you're fine. I don't use MySQL or Apache.

In any case, it sounds like your complaints have nothing to do with OS
X. Having said that, various annoyances with OS X have made me switch
completely to Ubuntu full-time.

-- 
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: Pain on OSX

2011-07-28 Thread Kolbe
lol.

what's your recommended build for OSX though if I were to use django?

On Jul 28, 9:41 pm, Shawn Milochik  wrote:
> I've never had a problem with Django on OS X. I have had problems with
> psycopg2 due to the default Python that comes with OS X, but if you
> recompile Python you're fine. I don't use MySQL or Apache.
>
> In any case, it sounds like your complaints have nothing to do with OS
> X. Having said that, various annoyances with OS X have made me switch
> completely to Ubuntu full-time.

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



Satchmo, the bloated manatee

2011-07-28 Thread Bobby Roberts
satchmo has become a bloated manatee of a codebase.  Does anyone know
why it run so slowly now?  Or, do you have to feed it treats or
something secretive to get it running properly?  I've got two satchmo
sites on a 256mb slice at slicehost and they are pretty much unusable
at the moment.

-- 
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: Pain on OSX

2011-07-28 Thread Shawn Milochik
On Thu, Jul 28, 2011 at 10:08 AM, Kolbe  wrote:
> lol.
>
> what's your recommended build for OSX though if I were to use django?
>


I don't know what you mean by 'build,' but my standard setup was
compiling my own Python (requires installing XCode) and using
PostgreSQL (using the EnterpriseDB installer).

Then a virtualenv for each project with --no-site-packages used.

That's pretty much it. I use Postgres instead of sqlite because sqlite
doesn't enforce all the constraints so, for example, unique_together
isn't enforced. When you go to production you'll get errors you missed
in development. If you use sqlite in production as well then you'll
miss the errors completely and end up with different data than you
expected.

The only "trick" to it was compiling psycopg2 (the Postgres driver for
Python). It only works with 32-bit Python, so you'll have to compile
Python as 32-bit instead of the default 64 that comes with OS X.
Here's a blog post I wrote about how to take care of that.
http://shawnmilo.blogspot.com/2009/11/psycopg2-on-snow-leopard.html

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



djangoadvent.com is down ?

2011-07-28 Thread Lorenzo Franceschini

Hi,
some time ago I bookmarked some posts on http://djangoadvent.com that 
seemed very interesting to me; yesterday I wanted to read some of them, 
but I wasn't able to retrieve them.  The website was unreacheable, and I 
was able to found a cached version of only a few of them.


Do you know anything about it ? Can you point me to a mirror ?

Thanks in advance for any answer.

--
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: Pain on OSX

2011-07-28 Thread william ratcliff
I also recommend the enterprisedb distribution.   I don't recall rebuilding
python for snow lion, but it's been awhile...I have also noticed that
sqllite does not enforce all constraints, so it's good to start with
postgres sooner rather than later...I can't help you with apache...

William

On Thu, Jul 28, 2011 at 10:38 AM, Shawn Milochik  wrote:

> On Thu, Jul 28, 2011 at 10:08 AM, Kolbe 
> wrote:
> > lol.
> >
> > what's your recommended build for OSX though if I were to use django?
> >
>
>
> I don't know what you mean by 'build,' but my standard setup was
> compiling my own Python (requires installing XCode) and using
> PostgreSQL (using the EnterpriseDB installer).
>
> Then a virtualenv for each project with --no-site-packages used.
>
> That's pretty much it. I use Postgres instead of sqlite because sqlite
> doesn't enforce all the constraints so, for example, unique_together
> isn't enforced. When you go to production you'll get errors you missed
> in development. If you use sqlite in production as well then you'll
> miss the errors completely and end up with different data than you
> expected.
>
> The only "trick" to it was compiling psycopg2 (the Postgres driver for
> Python). It only works with 32-bit Python, so you'll have to compile
> Python as 32-bit instead of the default 64 that comes with OS X.
> Here's a blog post I wrote about how to take care of that.
> http://shawnmilo.blogspot.com/2009/11/psycopg2-on-snow-leopard.html
>
> --
> 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: Pain on OSX

2011-07-28 Thread Andre Terra
Not to mention SQLite's 'Database is locked' issue.. I too recommend
postgres.

Cheers,
AT

On Thu, Jul 28, 2011 at 11:55 AM, william ratcliff <
william.ratcl...@gmail.com> wrote:

> I also recommend the enterprisedb distribution.   I don't recall rebuilding
> python for snow lion, but it's been awhile...I have also noticed that
> sqllite does not enforce all constraints, so it's good to start with
> postgres sooner rather than later...I can't help you with apache...
>
> William
>
>
> On Thu, Jul 28, 2011 at 10:38 AM, Shawn Milochik wrote:
>
>> On Thu, Jul 28, 2011 at 10:08 AM, Kolbe 
>> wrote:
>> > lol.
>> >
>> > what's your recommended build for OSX though if I were to use django?
>> >
>>
>>
>> I don't know what you mean by 'build,' but my standard setup was
>> compiling my own Python (requires installing XCode) and using
>> PostgreSQL (using the EnterpriseDB installer).
>>
>> Then a virtualenv for each project with --no-site-packages used.
>>
>> That's pretty much it. I use Postgres instead of sqlite because sqlite
>> doesn't enforce all the constraints so, for example, unique_together
>> isn't enforced. When you go to production you'll get errors you missed
>> in development. If you use sqlite in production as well then you'll
>> miss the errors completely and end up with different data than you
>> expected.
>>
>> The only "trick" to it was compiling psycopg2 (the Postgres driver for
>> Python). It only works with 32-bit Python, so you'll have to compile
>> Python as 32-bit instead of the default 64 that comes with OS X.
>> Here's a blog post I wrote about how to take care of that.
>> http://shawnmilo.blogspot.com/2009/11/psycopg2-on-snow-leopard.html
>>
>> --
>> 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.



[OFF] Job Opportunity at São Paulo - SP - Brazil

2011-07-28 Thread Rogerio Carrasqueira
Hello Everybody!

We have a job opportunity to work with us at Direct Flow/Performance, to
join us please send your resumée to *va...@directflow.com.br or
va...@directperformance.com.br*

If you are hard coder and don't disguise it and you are a member from many
foruns about frameworks and tech talks, we want you!!

We are looking for a experencied developer professional to work with web and
web standards and API integrations with other systems

Our chalenge is to develop simple but powerful and smart solutions that will
be used for project that will solve problems with maximum efficiency

Job Profile:

- Graduating on Computing Engineering, Computing Science, Mathematics
Computing Applied or other equivalent grading.
- Experience with web technologies using frameworks like Django, over Python
Language
- Updated about the news of your favorite programming language e about
Google Platforms
- Its is essencial the ability to solve problem with analytic capacity

Differentials:

- Skills about the use of the Google API's, AdServers Platforms
- Skills about the use of Web Analytics Systems
- Skills about developing using Django Framework
Our Benefits:

- Carreer Plan
- Salary compatible with the market
- Health Care
- Education continuing program

Rogério Carrasqueira

---
e-mail: rogerio.carrasque...@gmail.com
skype: rgcarrasqueira
MSN: rcarrasque...@hotmail.com
ICQ: 50525616
Tel.: (11) 7805-0074

-- 
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: Extending new User form

2011-07-28 Thread Derek
On Jul 28, 10:31 am, Shegoroa  wrote:
> I am having difficulty figuring out how to make an admin when creating
> a new user to have an extra field specifying users location.
>
> I found lots of information on how to extend the user profile and i
> did so
> (source of 
> information)http://stackoverflow.com/questions/44109/extending-the-user-model-wit...
>
> But now I want the admin every time when he is creating a new user for
> there to be a new field under Personal Information of a user to have
> an extra field for Location of user.

That is an old post (2008) - you're better off starting with the
current documentation:
https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users

Try and follow this and ask back here if you get stuck; showing what
code you have created and identifying where/how it does not work (also
see: https://code.djangoproject.com/wiki/UsingTheMailingList )

-- 
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 open source cashflow management app

2011-07-28 Thread Derek

On Jul 28, 5:27 am, zodman  wrote:
> the app is back :)

Oops! Google Chrome could not find misgastos.zodman.com.mxits

Looks like:
http://misgastos.zodman.com.mx/
is the correct URL!


-- 
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: Pain on OSX

2011-07-28 Thread Kolbe
thanks for the pointers guys! really really helpful

On Jul 28, 11:05 pm, Andre Terra  wrote:
> Not to mention SQLite's 'Database is locked' issue.. I too recommend
> postgres.
>
> Cheers,
> AT
>
> On Thu, Jul 28, 2011 at 11:55 AM, william ratcliff <
>
>
>
>
>
>
>
> william.ratcl...@gmail.com> wrote:
> > I also recommend the enterprisedb distribution.   I don't recall rebuilding
> > python for snow lion, but it's been awhile...I have also noticed that
> > sqllite does not enforce all constraints, so it's good to start with
> > postgres sooner rather than later...I can't help you with apache...
>
> > William
>
> > On Thu, Jul 28, 2011 at 10:38 AM, Shawn Milochik wrote:
>
> >> On Thu, Jul 28, 2011 at 10:08 AM, Kolbe 
> >> wrote:
> >> > lol.
>
> >> > what's your recommended build for OSX though if I were to use django?
>
> >> I don't know what you mean by 'build,' but my standard setup was
> >> compiling my own Python (requires installing XCode) and using
> >> PostgreSQL (using the EnterpriseDB installer).
>
> >> Then a virtualenv for each project with --no-site-packages used.
>
> >> That's pretty much it. I use Postgres instead of sqlite because sqlite
> >> doesn't enforce all the constraints so, for example, unique_together
> >> isn't enforced. When you go to production you'll get errors you missed
> >> in development. If you use sqlite in production as well then you'll
> >> miss the errors completely and end up with different data than you
> >> expected.
>
> >> The only "trick" to it was compiling psycopg2 (the Postgres driver for
> >> Python). It only works with 32-bit Python, so you'll have to compile
> >> Python as 32-bit instead of the default 64 that comes with OS X.
> >> Here's a blog post I wrote about how to take care of that.
> >>http://shawnmilo.blogspot.com/2009/11/psycopg2-on-snow-leopard.html
>
> >> --
> >> 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: Django open source cashflow management app

2011-07-28 Thread Derek
On Jul 28, 5:33 pm, Derek  wrote:
> On Jul 28, 5:27 am, zodman  wrote:
>
> > the app is back :)
>
> Oops! Google Chrome could not find misgastos.zodman.com.mxits
>
> Looks like:http://misgastos.zodman.com.mx/
> is the correct URL!

But unfortunately, the registration does not work :(

-- 
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: [gripe] Pain on OSX

2011-07-28 Thread Andy Dustman
My development setup is:

Snow Leopard
X-Code
MacPorts
Python-2.6 via MacPorts
MySQLdb via MacPorts
MySQL server on an Ubuntu VM (mimics production)
Django-1.3 via virtualenv easy_install
WingIDE or Django internal HTTP server

Production (and pre-production testing) is on Ubuntu Lucid, Apache, mod_wsgi.

On Thu, Jul 28, 2011 at 9:35 AM, Kolbe  wrote:
> Is it just me, or is it that painful just to get Django running on
> OSX?
>
> During development, I had problems with Mysql_db. More or less got
> that solved, and been reading postgre is more or less the preferred
> choice? Anyway, for most of development, I've been just using sqlite.
>
> Now I have problems with Apache - trying to install mod_wsgi and I
> need to first download developer tools to get gcc and etc...
>
> Then there's the problem of a good hosting provider. You'd probably
> just want a hosting provider to have the server all ready and all
> you'd need to do is upload the files and off you go!
>
> *gripe*
>
> --
> 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.
>
>



-- 
Question the answers

-- 
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: Import error

2011-07-28 Thread sakthi vel
Ha ha. not needed. i solved my problem. By the way if you want assistance,
post me. its absolutely free.

On Wed, Jul 27, 2011 at 3:36 AM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:

> On 26 juil, 18:59, shakthi  wrote:
> > i am implementing the django admin interface in my site.
> > after changing the settings and the urls file, i am getting an import
> > error on the web browser.
> > the error was "import error"
> > "No module named urls"
> >
> > also when i check for that file by giving the command 'pydoc
> > django.contrib.admin.urls' in terminal, i am getting import
> > error."settings cannot be imported because environment variable
> > DJANGO_SETTINGS_MODULE is undefined
> >
> > please sort it out
>
> No problem. My daily fees are about €500, please contact me in private
> so we can agree on the legal details before I start working on your
> "problem".
>
> --
> 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: USE_I18N vs. USE_L10N

2011-07-28 Thread Lucy Brennan
Before I comment, I would like to actually know if I got it right. In 
Django:

USE_I18N: translation
USE_L10N: localized formatting

Right?

-- 
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/-/bHE2JUNIyowJ.
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: USE_I18N vs. USE_L10N

2011-07-28 Thread Masklinn
On 2011-07-28, at 18:37 , Lucy Brennan wrote:
> Before I comment, I would like to actually know if I got it right. In 
> Django:
> 
> USE_I18N: translation
> USE_L10N: localized formatting
> 
> Right?
yes.

-- 
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: Pain on OSX

2011-07-28 Thread Bruno Tikami
On Thu, Jul 28, 2011 at 12:35 PM, Kolbe wrote:

> thanks for the pointers guys! really really helpful
>
>
Kolbe, have you updated your Xcode ? If not, do so in order to have your gcc
updated/compatible with Lion. I had problems with pycrypto and beautifulsoup
that were gone after updating xcode.

Cheers,

Tkm

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



Transform model field to custom form field when creating from instance

2011-07-28 Thread Arkaitz Jimenez
Hi,

I created a PostForm, ModelForm for Post model that has a ManyToMany
relationship with a model called Test, I use a CharField and a
clean_test(): to convert the comma separated list of test names to a
list of Test objects and this works perfectly.

Now, when I want to use the PostForm for editing a Post I want the
CharField to display a comma separated list of test names from the
ManyToMany field. I can't find where in my PostForm I could hookup to
fill up the CharField when I do PostForm(instance=instance) to get my
ManToMany converted to a list of names.

Apart from that, is it good manners to access and create other Model
objects from ModelForms? like in clean_ methods?

Thanks

Arkaitz

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



save_m2m and primary key.

2011-07-28 Thread GP
Hello,

I am creating a new backend with jbase database using jython and
zxjdbc. The new backend works fine (mostly).

Able to login to admin page. completed the "web poll" application from
documentation. I face proble with save_m2m. Lets say when I want to
create a group. The django gives error that primiary key not found. I
understand django requires primary key to do further commits.

For testing purpose I worked around this problem by setting
@transaction.autocommit in /django/contrib/admin/options.py for
add_view. If I have autocommit for this, then it works fine. The
database requires the commit to be done for the record to have been
created.

I would like to know, which is the best way to handle this?
Thanks in advance.
Regards
Guru

-- 
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: Admin model listing custom ordering

2011-07-28 Thread christian.posta
Is this something that can work for you?

https://docs.djangoproject.com/en/1.3/ref/models/options/#order-with-respect-to

If not, then the only thing i can do is recommend you review the
source code for how the ordering happens in the admin module for a
model.

The main spots to look at would be the get_ordering() method of the
ChangeList class (django/contrib/admin/views/main.py) and the
get_query_set() method of the same class. The ordering will definitely
change, regardless of the queryset you override in the ModelAdmin
class, but those two methods should give some clue as to what ordering
options are available to you (default is descending by ID). you may
wish to look closer than i did at the first line in the get_ordering()
method which goes like this:
lookup_opts, params = self.lookup_opts, self.params
there might be some additional ordering that can be accomplished with
those variables.

good luck, let me know if you figure it out

On Jul 28, 6:07 am, Vinicius Massuchetto
 wrote:
> I got a model with a ForeignKey field, and I want the default listing
> of this model to be ordered by this field.
>
> I get the correct `qs.query` SQL statement, but for some reason the
> admin listing is not following it. This is what I've done so far:
>
>     class SomeAdminModel(admin.ModelAdmin):
>         # ... fields
>
>         def queryset(self, request):
>             qs = super(SomeAdminModel, self).queryset(request)
>             fk_list = [1,2,7,3,5,6,4]
>             ordering = 'FIELD(`fk_field_id`, %s)' % ','.join(str(id)
> for id in fk_list)
>             qs = qs.filter(fk_field__in = fk_list).extra(
>                 select = {'ordering': ordering},
>                 order_by = ('ordering',)
>             )
>             return qs
>
> What can be preventing this from behave as desired? Do I need to
> override anything else?
>
> Thanks in advance.
> --
> Vinicius Massuchettohttp://vinicius.soylocoporti.org.br

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



about django

2011-07-28 Thread Ghanshyam Pandey
Hello,

i want to learn django, but from where to start, I do not know.


Would you please help me?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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: USE_I18N vs. USE_L10N

2011-07-28 Thread Lucy Brennan
Did anybody read the links I supplied. Or maybe you were busy plussing on 
Google+ :)

So there seems to be two pairs of definitions for I18N / L10N:

a) I18N / L10N ~ (building software so ready to be 
locale-language-customized  /  making a specific localized version )

b) I18N / L10N ~ (translation/localized formatting)

When reading Wikipedia 
(http://en.wikipedia.org/wiki/Internationalization_and_localization). I 
understand the option a), and I don't think they mention that the terms can 
have different meanings. When reading Django's article 
https://docs.djangoproject.com/en/dev/topics/i18n/, I get exactly the same 
understanding. 

People in this thread talk about meaning b) as if it is a long established 
meaning and common knowledge. So I guess it is. But I did not find anything 
describing this meaning when I was trying to figure out what USE_L10N and 
USE_I18N meant. 

So if you are so certain that I18N / L10N are common knowledge for 
translation/localized formatting, I suggest that you add that knowledge to 
the abovementioned Wikipedia article and Django documentation article. 

Furthermore, the 
https://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#use-i18n, 
should not just say that it will "turn off the internationalization 
machinery", since that is not helpful unless "internationalization 
machinery" is defined. And come on, why not just add that this is 
translation. 


Lucy

-- 
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/-/hcs0wCXkQ0EJ.
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: about django

2011-07-28 Thread NISA BALAKRISHNAN
django book

On Thu, Jul 28, 2011 at 9:27 PM, Ghanshyam Pandey wrote:

> Hello,
>
> i want to learn django, but from where to start, I do not know.
>
>
> Would you please help me?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-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.
>



-- 
Thanks & Regards,

Nisa Balakrishnan,
SHARJAH, UAE.

-- 
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: about django

2011-07-28 Thread Carsten Jantzen
There is a good tutorial:
https://docs.djangoproject.com/en/1.3/intro/tutorial01/

I would recommend you start with that, I did and it was a good starting point.

/Carsten


2011/7/28 Ghanshyam Pandey :
> Hello,
>
> i want to learn django, but from where to start, I do not know.
>
>
> Would you please help me?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-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: about django

2011-07-28 Thread Mitesh Patel
Hi GPA,

Starts with here https://docs.djangoproject.com/en/1.3/

Thanks,

Mitesh Patel



On 28 July 2011 23:19, NISA BALAKRISHNAN wrote:

> django book
>
>
> On Thu, Jul 28, 2011 at 9:27 PM, Ghanshyam Pandey wrote:
>
>> Hello,
>>
>> i want to learn django, but from where to start, I do not know.
>>
>>
>> Would you please help me?
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-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.
>>
>
>
>
> --
> Thanks & Regards,
>
> Nisa Balakrishnan,
> SHARJAH, UAE.
>
> --
> 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: Satchmo, the bloated manatee

2011-07-28 Thread Jacob Kaplan-Moss
On Thu, Jul 28, 2011 at 7:15 AM, Bobby Roberts  wrote:
> satchmo has become a bloated manatee of a codebase.

Hey, this isn't OK. I can tell you're frustrated, but insulting other
people's work isn't acceptable around here. You should realize there
are real people, just like you, on the other side of these insults.
Attacking them isn't nice, and won't get you the help you need.

In general, you'll find that you'll get a lot more help if you're
polite. On this particular forum, not being polite isn't acceptable,
so if you insist on insults you'll need to find somewhere else to air
them.

Thanks.

Jacob

-- 
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: about django

2011-07-28 Thread Furqan Rauf
I think tutorial would be good to start with, like Carsten mentioned

On Thu, Jul 28, 2011 at 12:54 PM, Mitesh Patel
wrote:

> Hi GPA,
>
> Starts with here https://docs.djangoproject.com/en/1.3/
>
> Thanks,
>
> Mitesh Patel
>
>
>
>
> On 28 July 2011 23:19, NISA BALAKRISHNAN wrote:
>
>> django book
>>
>>
>> On Thu, Jul 28, 2011 at 9:27 PM, Ghanshyam Pandey wrote:
>>
>>> Hello,
>>>
>>> i want to learn django, but from where to start, I do not know.
>>>
>>>
>>> Would you please help me?
>>>
>>> Thanks
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-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.
>>>
>>
>>
>>
>> --
>> Thanks & Regards,
>>
>> Nisa Balakrishnan,
>> SHARJAH, UAE.
>>
>> --
>> 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.
>



-- 
*-Furqan Rauf*
*Do you love your creator? Love your fellow-beings first. -Prophet Muhammad
*
*http://www.amway.com/furqanrauf*

-- 
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: Extending the User form

2011-07-28 Thread sandeep kaur
On Thu, Jul 28, 2011 at 4:39 PM, Sheogora  wrote:
>
> I have extended the User Profile by adding my own field,
> how do I change the New user form in the admin, to show the new field?
>
This can be done by simply adding your new field in list display under
User Profile of admin.py file. And by doing this you will get your new
field in admin.

-- 
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: Satchmo, the bloated manatee

2011-07-28 Thread Cal Leeming [Simplicity Media Ltd]
On Thu, Jul 28, 2011 at 7:03 PM, Jacob Kaplan-Moss wrote:

> On Thu, Jul 28, 2011 at 7:15 AM, Bobby Roberts 
> wrote:
> > satchmo has become a bloated manatee of a codebase.
>

> Hey, this isn't OK. I can tell you're frustrated, but insulting other
> people's work isn't acceptable around here. You should realize there
> are real people, just like you, on the other side of these insults.
> Attacking them isn't nice, and won't get you the help you need.
>

Hold on, we are in danger of restricting the freedom of speech on this
mailing list.

I think OP was just expressing his honest opinion, and his comment wasn't
rude or insulting in any way.

Just because something is open source (and/or contributed to by people in
their spare time) does not make it exempt from scrutiny/criticism.


> In general, you'll find that you'll get a lot more help if you're
> polite. On this particular forum, not being polite isn't acceptable,
> so if you insist on insults you'll need to find somewhere else to air
> them.
>
> Thanks.
>
> Jacob
>
> --
> 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: Django open source cashflow management app

2011-07-28 Thread Derek
On 28 July 2011 17:35, Derek  wrote:

> On Jul 28, 5:33 pm, Derek  wrote:
> > On Jul 28, 5:27 am, zodman  wrote:
> >
> > > the app is back :)
> >
> > Oops! Google Chrome could not find misgastos.zodman.com.mxits
> >
> > Looks like:http://misgastos.zodman.com.mx/
> > is the correct URL!
>
> But unfortunately, the registration does not work :(
>
> --
> 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.
>
> OK; it actually does - blame my lack of Portuguese - an activation link is
sent to your email - then you can access it!

-- 
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: Satchmo, the bloated manatee

2011-07-28 Thread Matt Mansour
I have one cart running over 17K SKUs that is fast. (save for
generating product variations). It's hosted at Webfaction with a
hosting plan less powerful than yours.  Have you checked the basics.
Debug mode off.  Caching on. (I am not even using memcached. Just
file.). I am using Postgres.

The Satchmo group is great. I bet if you post this question there, and
leave off the first sentence, or at least tweak the tone and tenor of
it, you'll eventually get pointed in the right direction.

If you have a lot of product variations for each product you may have
to use custom products instead.

Good luck
~Matt

On Thu, Jul 28, 2011 at 11:16 AM, Cal Leeming [Simplicity Media Ltd]
 wrote:
>
>
> On Thu, Jul 28, 2011 at 7:03 PM, Jacob Kaplan-Moss 
> wrote:
>>
>> On Thu, Jul 28, 2011 at 7:15 AM, Bobby Roberts 
>> wrote:
>> > satchmo has become a bloated manatee of a codebase.
>>
>> Hey, this isn't OK. I can tell you're frustrated, but insulting other
>> people's work isn't acceptable around here. You should realize there
>> are real people, just like you, on the other side of these insults.
>> Attacking them isn't nice, and won't get you the help you need.
>
> Hold on, we are in danger of restricting the freedom of speech on this
> mailing list.
> I think OP was just expressing his honest opinion, and his comment wasn't
> rude or insulting in any way.
> Just because something is open source (and/or contributed to by people in
> their spare time) does not make it exempt from scrutiny/criticism.
>>
>> In general, you'll find that you'll get a lot more help if you're
>> polite. On this particular forum, not being polite isn't acceptable,
>> so if you insist on insults you'll need to find somewhere else to air
>> them.
>>
>> Thanks.
>>
>> Jacob
>>
>> --
>> 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: TimeField with minute-resolution in forms

2011-07-28 Thread Brian
Just in case anyone else has the same problem and finds their way here...

The answers were there in the documentation once I rooted around for a 
while. I just need to override the default form field provided for my time 
model field and explicitly specify the allowed formats.

class EntryForm(ModelForm):
time = TimeField(required=True,
 error_messages = {'invalid' :
   "Please enter a time of the form 
HH:MM"},
 widget=TimeInput(format='%H:%M'),
 input_formats=['%H:%M'])
class Meta:
model = Entry
# time is a models.TimeField in entry/models.py

-- 
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/-/EDD9Y_G4czAJ.
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: about django

2011-07-28 Thread bruno desthuilliers
On 28 juil, 19:27, Ghanshyam Pandey  wrote:
> Hello,
>
> i want to learn django, but from where to start, I do not know.


* If you don't know Python, start with the Python tutorial - it will
save you a lot of pain. And don't forget to quickly browse the stdlib
doc so you don't reinvent the proverbial squared wheel.

* If you don't have working experience with web apps and the HTTP
protocol, start browsing the RFC. It's not going to be fun, but if you
manage to get the big picture it will also help you.

* If you never learned about SQL, the relational model, and database
design, it's about time to do someghing about it. There are quite a
few articles, tuts and whatnot (of varying quality) on the net.

* Oh, and some HTML and CSS knowledge might help.

* And at least knowing how to configure Apache (or Nginx or whather
your favorite web server is) might help too.

Once you are ok with all this, the Django tutorial is obviously the
place to start. While following it, try to search the doc for more in-
depth infos, so you'll have a hint about what Django provides and
where to look for for more detailed informations.

Or you can forget above all this and start with the tutorial, but it
might be way more painfull and way less rewarding, depending on your
background. The point is: the FineManual (rightly) assume you already
know Python, SQL, database design, HTML, HTTP etc, so if you don't
quite a few things won't make sense.

My 2 cents...

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



Query about Django vs Web2Py

2011-07-28 Thread spawgi
Hello fellow Django users,

First, this is not to start any flame war, but to get sincere advice.

I started to learn Django and also completed the tutorial. However I have
also come across another framework Web2Py. I wanted to get the perspective
of django users on this framework and its comparison with django. Any
constructive thoughts will be really helpful for me to decide whether I need
to learn both of I can continue my focus on django.

Thanks and Regards,
Sumod

-- 
http://spawgi.wordpress.com
We can do it and do it better.

-- 
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: Transform model field to custom form field when creating from instance

2011-07-28 Thread bruno desthuilliers
In 28 juil, 19:00, Arkaitz Jimenez  wrote:
> Hi,
>
> I created a PostForm, ModelForm for Post model that has a ManyToMany
> relationship with a model called Test, I use a CharField and a
> clean_test(): to convert the comma separated list of test names to a
> list of Test objects and this works perfectly.

Err... How do this work for not yet existing Test instances ?


> Now, when I want to use the PostForm for editing a Post I want the
> CharField to display a comma separated list of test names from the
> ManyToMany field. I can't find where in my PostForm I could hookup to
> fill up the CharField when I do PostForm(instance=instance) to get my
> ManToMany converted to a list of names.

the __init__ method looks like the right place to handle this. First
make sure you exclude the related field from the ModelForm (cf the doc
for ModelForms on how to do this) and add your own field to the form
definition, and make sure you call on the supercall __init__ before
you populate the field.

> Apart from that, is it good manners to access and create other Model
> objects from ModelForms?

* "access" : in the __init__ method.
* "create" : in the save method

> like in clean_ methods?

*don't*. The clean methods are about user inputs validation, and
should be idempotent (ie: should not alter the database state).

-- 
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: Query about Django vs Web2Py

2011-07-28 Thread Furqan Rauf
in my opinion its your decision, I have done some django and currently
exploring web2py bit by bit. I think in Django you have much more control
from start while in web2py you can start write off and then at some point
when you need more complex behavior to implement you can go back and
override stuff, also I heard never tried but web2py's models are more
compatible with GAE while in django you have to redo them to be compliant
with GAE. The Gurus can shed more light on it :)

On Thu, Jul 28, 2011 at 3:54 PM,  wrote:

> Hello fellow Django users,
>
> First, this is not to start any flame war, but to get sincere advice.
>
> I started to learn Django and also completed the tutorial. However I have
> also come across another framework Web2Py. I wanted to get the perspective
> of django users on this framework and its comparison with django. Any
> constructive thoughts will be really helpful for me to decide whether I need
> to learn both of I can continue my focus on django.
>
> Thanks and Regards,
> Sumod
>
> --
> http://spawgi.wordpress.com
> We can do it and do it better.
>
> --
> 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.
>



-- 
*-Furqan Rauf*
*Do you love your creator? Love your fellow-beings first. -Prophet Muhammad
*
*http://www.amway.com/furqanrauf*

-- 
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: Transform model field to custom form field when creating from instance

2011-07-28 Thread arkai...@gmail.com
On Thu, Jul 28, 2011 at 9:58 PM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:

> > I use a CharField and a
> > clean_test(): to convert the comma separated list of test names to a
> > list of Test objects and this works perfectly.
>
> Err... How do this work for not yet existing Test instances ?
>

I  do create Test instances on demand here.

the __init__ method looks like the right place to handle this. First
> make sure you exclude the related field from the ModelForm (cf the doc
> for ModelForms on how to do this) and add your own field to the form
> definition, and make sure you call on the supercall __init__ before
> you populate the field.
>

Seems  like the only way, but I've always been a bit reluctant of overriding
__init__ methods on Django core objects (models, forms, etc...), is there
any concern I should have if I override __init__ apart of calling supers
__init__ ?

>
> > Apart from that, is it good manners to access and create other Model
> > objects from ModelForms?
>
> * "access" : in the __init__ method.
> * "create" : in the save method
>
> > like in clean_ methods?
>
> *don't*. The clean methods are about user inputs validation, and
> should be idempotent (ie: should not alter the database state).
>

This makes sense to me.

Thanks

Arkaitz

-- 
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: Transform model field to custom form field when creating from instance

2011-07-28 Thread bruno desthuilliers
On 28 juil, 23:04, "arkai...@gmail.com"  wrote:
> On Thu, Jul 28, 2011 at 9:58 PM, bruno desthuilliers <
>
>> the __init__ method looks like the right place to handle this. First
>> make sure you exclude the related field from the ModelForm (cf the doc
>> for ModelForms on how to do this) and add your own field to the form
>> definition, and make sure you call on the supercall __init__ before
>> you populate the field.
>
> Seems  like the only way, but I've always been a bit reluctant of overriding
> __init__ methods on Django core objects (models, forms, etc...),

You shouldn't.

> is there
> any concern I should have if I override __init__ apart of calling supers
> __init__ ?

When it comes to forms, there are a couple gotchas with fields
initialisation, specially when it comes to form.Fields  vs
BoundFields. The main rule here is to always call on super __init__ -
passing it all the other args - *before* you do anything with fields -
but you can of course preprocess the args before calling on super
__init__ (specially "initials").

Also, a form (and even more a model form) has a somewhat lengthy
argument list with quite a few defaults. From experience, the best
thing is to use a simple (*args, **kw) signature and pass everything
to the superclass, or, if your form requires custom args, put them as
non-default arguments before the *args **kw part, so you don't have to
mess with the remaining ones.

And remember that Django is open-source so if you have any doubt, you
can always browse the source code. It's not exactly trivial
(metaclasses involved...) but it's still rather straightforward, no
frills Python code (nothing like Zope or else).

My 2 cents...

-- 
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: Satchmo, the bloated manatee

2011-07-28 Thread Russell Keith-Magee
On Fri, Jul 29, 2011 at 2:16 AM, Cal Leeming [Simplicity Media Ltd]
 wrote:
>
>
> On Thu, Jul 28, 2011 at 7:03 PM, Jacob Kaplan-Moss 
> wrote:
>>
>> On Thu, Jul 28, 2011 at 7:15 AM, Bobby Roberts 
>> wrote:
>> > satchmo has become a bloated manatee of a codebase.
>>
>> Hey, this isn't OK. I can tell you're frustrated, but insulting other
>> people's work isn't acceptable around here. You should realize there
>> are real people, just like you, on the other side of these insults.
>> Attacking them isn't nice, and won't get you the help you need.
>
> Hold on, we are in danger of restricting the freedom of speech on this
> mailing list.
> I think OP was just expressing his honest opinion, and his comment wasn't
> rude or insulting in any way.

Yes, it really was. He opened a request for a subject line and first
sentence by comparing Satchmo to a fat, ungainly animal. That's isn't
a productive way to begin a request for help.

> Just because something is open source (and/or contributed to by people in
> their spare time) does not make it exempt from scrutiny/criticism.

There's a difference between criticism and insults.

Consider the following:

"Problems with recent Satchmo versions

I'm having some serious problems with recent versions of Satchmo. Over
the last couple of versions, it seems to have massively increased it's
memory requirements -- to the extent that my 256MB slice at Slicehost
isn't really usable any more. Am I missing something, or do I need to
feed it treats to get it to work properly"

Almost exactly the same content, but doesn't start with a slap in the
face to the developers of Satchmo.

Better still would be to document exact what he has done, why he did
it, and what he has observed. That way, someone would be able to help
him.

Better still again would be to ask the same question on the right
forum -- the Satchmo mailing list.

These aren't controversial ideas -- in fact, they should be the core
of the "how to ask questions on the mailing list" wiki page i.e.,

 * Don't insult the people you want to help you
 * Provide as much detail as possible
 * Ask the question in the right place.

Yours,
Russ Magee %-)

-- 
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 do I change my user password on Django's bug tracker?

2011-07-28 Thread Jacob Kaplan-Moss
On Tue, Jul 26, 2011 at 7:07 AM, cool-RR  wrote:
> How do I change my user password on Django's bug tracker?

https://www.djangoproject.com/accounts/password/change/

If you've forgotten your password, see
https://www.djangoproject.com/accounts/password/reset/.

Jacob

-- 
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, Pinax, Dreamhost Project

2011-07-28 Thread Jonathan of Cambridge
Hey Jeremy,

You want to use the development version and the basic project. (This
is a little counter intuitive based on the current website.
I found this out by posting and reading on Pinax Users Google Group. I
read that group more frequently than this one.)

The creators of Pinax do consulting work as do others.  You probably
want to be more specific in telling people what you want your site to
do
for you and your background to receive more specific help.

If you need more assistance, feel free to ask.

Jonathan of Cambridge

On Jul 26, 12:03 pm, Jeremy  wrote:
> Hello all, I'm not sure if this is the right place to post this, but
> was sent this direction, so if not please let me know.  I'm incredibly
> new to Django, and I'm trying to set up a personal site with a Pinax
> install.  I chose Pinax because most of what the site needs to do,
> Pinax is capable of "out of the box."  I'm sure there are similar
> options and if so please let me know.  The point is I'm running into
> errors just getting the site off the ground, but I need to have it up
> and running really soon.  I am totally willing to pay someone to give
> me a hand with this (keep in mind my funds are a little limited) via
> Pay Pal.  Let me know if anyone can help.  Again, let me know if this
> post isn't appropriate and I'll try and find a better place for it.
>
> Feel free to contact me at jeremycran...@gmail.com with your rates.
> Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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: Satchmo, the bloated manatee

2011-07-28 Thread Eric Chamberlain
On Jul 28, 2011, at 4:26 PM, Russell Keith-Magee wrote:

> 
> Yes, it really was. He opened a request for a subject line and first
> sentence by comparing Satchmo to a fat, ungainly animal. That's isn't
> a productive way to begin a request for help.

Now let's not dis the manatee.  Here's a manatee drinking from a garden hose 
video  I made in front of my parent's home.

People should be respectful of manatees and open source developers.

--
Eric Chamberlain, Founder
RingFree Mobility Inc.

-- 
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: about django

2011-07-28 Thread Harjot Gill
Refer the following site.It will really help you.This site will help
you to learn django from starting and this are some tutorials that
will help you to learn django.

www.djangoproject.com

Best of luck !

-- 
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 admin upload image to few folders

2011-07-28 Thread Jonathan of Cambridge
I've been working on using django-filetransfers.

Curious whether it works well for you.

My current challenge is that I want to use the index as the file name
for the url rather than the pk.  Anyone have an idea how to do that
easily?

I'm thinking this is a simple question about databases in django.

Thank you in advance,

Jonathan
-

class UploadModel(models.Model):
file = models.FileField(upload_to='uploads/%Y/%m/%d/%H/%M/%S/')

class UploadForm(forms.ModelForm):
class Meta:
model = UploadModel

from filetransfers.api import serve_file

def download_handler(request, pk):
upload = get_object_or_404(UploadModel, pk=pk)
return serve_file(request, upload.file)


On Jul 23, 1:17 am, Vusal Alishov  wrote:
> Hello, I want to upload image in django-admin interface to few
> folders.
> My models image field such: image =
> models.ImageField(upload_to='images')
> How can I do it?

-- 
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: about django

2011-07-28 Thread Phang Mulianto
welcome to the club. ...
start with the documentation like others said, then more deep buy a book for
reference, then create a pilot project...
On Jul 29, 2011 10:08 AM, "Harjot Gill"  wrote:
> Refer the following site.It will really help you.This site will help
> you to learn django from starting and this are some tutorials that
> will help you to learn django.
>
> www.djangoproject.com
>
> Best of luck !
>
> --
> 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: USE_I18N vs. USE_L10N

2011-07-28 Thread kenneth gonsalves
On Thu, 2011-07-28 at 09:37 -0700, Lucy Brennan wrote:
> Before I comment, I would like to actually know if I got it right. In
> Django:
> 
> USE_I18N: translation
> USE_L10N: localized formatting
> 
> Right? 

wrong

-- 
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: USE_I18N vs. USE_L10N

2011-07-28 Thread Mike Dewhirst

On 29/07/2011 1:56pm, kenneth gonsalves wrote:

On Thu, 2011-07-28 at 09:37 -0700, Lucy Brennan wrote:

Before I comment, I would like to actually know if I got it right. In
Django:

USE_I18N: translation
USE_L10N: localized formatting

Right?

wrong


http://en.wikipedia.org/wiki/Internationalization_and_localization



--
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: USE_I18N vs. USE_L10N

2011-07-28 Thread Russell Keith-Magee
On Fri, Jul 29, 2011 at 11:56 AM, kenneth gonsalves
 wrote:
> On Thu, 2011-07-28 at 09:37 -0700, Lucy Brennan wrote:
>> Before I comment, I would like to actually know if I got it right. In
>> Django:
>>
>> USE_I18N: translation
>> USE_L10N: localized formatting
>>
>> Right?
>
> wrong

Ok - seriously, Kenneth - if you're not going to take the time to
provide a full answer (with sentences, capitalization and all the
trimmings), please refrain from answering at all. A single word
response doesn't contribute anything to the discussion, and just makes
the whole community seem rude.

Lucy: Although there are a lot of people that use L10N and I18N
interchangeably, they are very distinct terms; any source you find
that uses them interchangeably is categorically wrong. However, the
two are very closely related, because localization usually happens in
the presence of internationalization, and vice versa -- hence the
common confusion. Although they share a Wikipedia page, if you read
the rest of the page, you'll see they make a distinction between a
localized system and an internationalized system.

To a first approximation, your translation vs formatting dissection
reflects Django's usage of the terms. I agree that Django's
documentation doesn't do the best job at pointing out the distinction
between the two (either in general, or in Django's interpretation. It
would certainly be worth opening a ticket to point out this limitation
of the existing docs.

If you feel like contributing, producing a patch to Django's
documentation to clarify the usage of i18n and l10n would be an
excellent way to get involved. It has been my experience that
newcomers often write the best high-level docs, because they're the
people who don't have any preconceived ideas, so they know what isn't
obvious, and what needs to be explained.

To the rest of this thread: I want to head something off at the pass
right now -- consider it a core-team decision that we're not going to
rename these settings. I18n and L10n are well understood terms to
anyone who has been dealing with adapting software to multiple
languages and cultures reasonable descriptions of what Django does
with the USE_I18N and USE_L10N settings, and we're not going to change
the values because someone comes up with a slightly better name. There
needs to be something fundamentally wrong or misleading before we
would even consider changing the name of a setting, and given that
these settings have been in the wild successfully for some time (I
think it's 4 years in the case of USE_I18N) you're not going to find
that here.

Yours,
Russ Magee %-)

-- 
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: Extending the User form

2011-07-28 Thread Gmail - neonmark

On 7/29/2011 6:11 AM, sandeep kaur wrote:

On Thu, Jul 28, 2011 at 4:39 PM, Sheogora  wrote:

I have extended the User Profile by adding my own field,
how do I change the New user form in the admin, to show the new field?


This can be done by simply adding your new field in list display under
User Profile of admin.py file. And by doing this you will get your new
field in admin.


did you extend the profile using the mechanism described here:
http://www.kolios.dk/2010/01/22/how-to-extend-django-user-class-and-change-authentication-middleware/comment-page-1/#comment-521
where a new User is defined to replace the existing one and the backend 
auth modified

Or did you use another method ?

--
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: USE_I18N vs. USE_L10N

2011-07-28 Thread kenneth gonsalves
On Fri, 2011-07-29 at 12:58 +0800, Russell Keith-Magee wrote:
> >> USE_I18N: translation
> >> USE_L10N: localized formatting
> >>
> >> Right?
> >
> > wrong
> 
> Ok - seriously, Kenneth - if you're not going to take the time to
> provide a full answer (with sentences, capitalization and all the
> trimmings), please refrain from answering at all. A single word
> response doesn't contribute anything to the discussion, and just makes
> the whole community seem rude. 

apologies - my LUG legacy still peeps out occasionally.

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