Re: Best CSS/JS compressor?

2011-06-02 Thread Anoop Thomas Mathew
On 3 June 2011 00:01, Mike  wrote:

> What is everyone using to combine CSS/JS?
>
> Has anyone tried mod_pagespeed? Perhaps Django-Compressor?
>


Hi,

+1 for django-compressor.
Its very easy to use, and it servers its purpose well...

There is  a django-compress , but I found compressor more "developer
friendly".
No idea about mod_pagespeed.


> All the discussions I found were quite dated.
>
> 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.
>
>
regards,
Anoop

-- 
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: Our new startup site build on Django and GAE is now live!

2011-06-02 Thread CareerDhaba tech
Cool looking site, but it would be useful to allow people to browse the site
a bit before having to register.

On Fri, Jun 3, 2011 at 9:45 AM, Gath  wrote:

> Great stuff!! Thumbs up.
>
> I like the concept!
>
> Please share you knowledge on how you did the Django/GAE integration.
>
> Gath
>
> On Jun 2, 10:02 am, maverick  wrote:
> > We build a pretty cool website LOCQL (www.LOCQL.com) purely on Django
> > and run on GAE has just went live!
> >
> > I would say development with Django is purely enjoyable experience,
> > however the Google Apps Engine does bring us some headache esp. we are
> > a location based service, the geo-location related search is a
> > challenge for us.
> >
> > I would like everyone who use Django to give us a try and feedback are
> > warmly welcome!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



django on cgi virtualenv

2011-06-02 Thread Mariano DAngelo
I'm trying to put my site in my hosting. I'm using awardspace:
I create a virtualenv with the necesary packets but installing mysqldb
I'm getting the error:


Traceback (most recent call last):
  File "setup.py", line 15, in ?
metadata, options = get_config()
  File "/home/www/MySQL-python-1.2.3/setup_posix.py", line 43, in
get_config
libs = mysql_config("libs_r")
  File "/home/www/MySQL-python-1.2.3/setup_posix.py", line 24, in
mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found


and trying to enter the site get:

2002, "Can't connect to local MySQL server through socket '/var/run/
mysqld/mysqld.sock' (2)")

I think mysqldb need mysql-server installed o mysql-client but I don't
have root access how can I do it?


the url:

http://www.podiodeportes.com.ar/fmahorro/apache/django.cgi/admin/

how can I install mysql-server socket for mysqldb

-- 
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: Our new startup site build on Django and GAE is now live!

2011-06-02 Thread Gath
Great stuff!! Thumbs up.

I like the concept!

Please share you knowledge on how you did the Django/GAE integration.

Gath

On Jun 2, 10:02 am, maverick  wrote:
> We build a pretty cool website LOCQL (www.LOCQL.com) purely on Django
> and run on GAE has just went live!
>
> I would say development with Django is purely enjoyable experience,
> however the Google Apps Engine does bring us some headache esp. we are
> a location based service, the geo-location related search is a
> challenge for us.
>
> I would like everyone who use Django to give us a try and feedback are
> warmly welcome!

-- 
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: Best CSS/JS compressor?

2011-06-02 Thread Martin Brochhaus
I'm using django_compressor and I am very happy with it!

Best regards,
Martin

-- 
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/-/eUlxYkp0NXdEQkVK.
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: Reasons to use managers

2011-06-02 Thread Martin Brochhaus
>From the documentation:

Adding extra Manager methods is the preferred way to add "table-level" 
functionality to your models. (For "row-level" functionality -- i.e., 
functions that act on a single instance of a model object -- use *Model 
methods*,
 
not custom Manager methods.)

https://docs.djangoproject.com/en/dev/topics/db/managers/

Best regards,
Martin

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



Pre-deployment steps for Django apps?

2011-06-02 Thread shantp
Hi all,

I am almost ready to make my app live. I am curious what steps you all take 
while getting your app ready to deploy.

Other than setting DEBUG=False, what steps do you take with your app? Any 
reusable apps you add? Are there extra things I need to do for security?

I'm not asking for deployment instructions because I know that has been 
talked to death, I'm more interested in things to do before deploying.

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



Re: How to create user on mobile app for Django site?

2011-06-02 Thread Alex Kamedov
On Fri, Jun 3, 2011 at 5:05 AM, Eric Chamberlain  wrote:

> Currently, we are looking at tastypie, piston is currently bogged down with
> a who will maintain it and where debate.
>
>
I have some expirience with piston about the half year ago. It isn't allow
to use difrent field sets of the same model in diffrent handlers.
According to docs tastypie has better design and looks like better than
piston in my use case. Thanks!


-- 
Alex Kamedov
skype: kamedovwww: kamedov.ru

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



Re: How to create user on mobile app for Django site?

2011-06-02 Thread Eric Chamberlain

On May 31, 2011, at 4:35 AM, Ivo Brodien wrote:

> What is the correct way to do the following:
> 
> 1) Mobile App from which a user can create a user/profile on the Django site
> 2) Allow authenticated users to create on the site and query personalized 
> data from the site
> 
> This is what I guess I have to do:
> 
> 1) Create a REST API  (probably with e.g. django-piston) on at the Django 
> site for creation and authentication 
> 
> How would I authenticate against the Django site?
> 
> When I use URL connections from the mobile app do I always have to send the 
> credentials or can the Django site identify me by storing session cookies on 
> the client just like as if the mobile app would be a browser?
> 

We've managed app authentication a few ways, depending on whether the end-user 
needs to be aware of the authentication or not.  

In some cases, we've used django-jsonrpc (sends username and password with each 
request, no session cookies) and for others, we've used piston with basic 
authentication and ASIHTTPRequest.  

Currently, we are looking at tastypie, piston is currently bogged down with a 
who will maintain it and where debate.




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



Odp: Re: Odp: Re: signals pre_save vs model's save()

2011-06-02 Thread Mateusz Harasymczuk
That was a very good and convincing post :}
I am testing a solution with .clean(), which IMHO is a better place to clean 
data before save()


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



Re: How to create user on mobile app for Django site?

2011-06-02 Thread Ivo Brodien
Hey Malcom,

thanks for the answer. Glad, I was more or less on right way.


>> How would I authenticate against the Django site?
> 
> Your choices are either to use username/passwords or OAuth. If you're using 
> username/passwords you can hook straight into the standard Django 
> authentication - just have your code do a POST to /admin/login with 
> username/password. That's not massively secure, so you might want to consider 
> doing it over SSL.

Of course SSL for clear text passwords, but why would I want to use the 
“/admin/login”? I think only staff can login under this URL. And wouldn’t I get 
a CSRF error anyway doing a POST  request out of nothing?

> 
>> When I use URL connections from the mobile app do I always have to send the 
>> credentials or can the Django site identify me by storing session cookies on 
>> the client just like as if the mobile app would be a browser?
>> 
> You can use session cookies just as on the desktop - the iPhone NSURLRequest 
> will handle cookies for you. This is true on most platforms, the only place 
> I've found where it doesn't work consistently is on Flash.

Good to know!

I have some questions about using OAUTH. As I understand OAUTH is good for when 
I want to give 3rd party access to the users data via my API without having the 
users give away their password to that 3rd party. I could consider my iPhone 
App a third party but I would still have to authorize against my Django Server 
to get the token. So if I don’t really want to open the API to a 3rd party 
there is no sense to use OAUTH? Using cookies and Django auth will be 
equivalent since with Django auth I would be sending a session-cookie where 
with OAUTH i would be sending the access_token in the URL so basically the same 
thing, isn’t it?

If I want my users to use another OAUTH provider to identify on my Django site 
there are solutions like Janrain and Gigya which cost a lot of money. And there 
is among others django-socialauth which is open source. If see it right the 
service from Janrain and Gigya is to unify the whole process with all the 
providers ad thus saving time in writing all the code one self. But why do they 
charge so much?

Cheers
Ivo 


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



debug=false issue

2011-06-02 Thread Bobby Roberts
hey -

i've got a weird issue with a django app.  The app runs great on both
the front end and in the /admin section when DEBUG=True in my
settings.py file.  However, whenever I set DEBUG=False in the settings
file so that i get tracebacks by email, the entire /admin section
404s.  Any idea what could be causing this?

-- 
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: Best CSS/JS compressor?

2011-06-02 Thread Maksymus007
we use yui for both js and css. but we have it a bit different,i mean we use
django tag for including files and some script that compress and join files
and both share the same naming algorithm.

Pozdrawiam, Maksymilian Pawlak
02-06-2011 21:08 użytkownik "Mike"  napisał:
> What is everyone using to combine CSS/JS?
>
> Has anyone tried mod_pagespeed? Perhaps Django-Compressor?
>
> All the discussions I found were quite dated.
>
> 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.



Best CSS/JS compressor?

2011-06-02 Thread Mike
What is everyone using to combine CSS/JS?

Has anyone tried mod_pagespeed? Perhaps Django-Compressor?

All the discussions I found were quite dated.

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: Our new startup site build on Django and GAE is now live!

2011-06-02 Thread Cal Leeming [Simplicity Media Ltd]
+1

On Thu, Jun 2, 2011 at 6:53 PM, Matteius  wrote:

> Yes I would appreciate a more integrated login approach or standard
> accounts.  Facebook login is possible without having to give you
> access to post to my wall.  Very restrictive in the current phase, but
> looks interesting underneath the login request.
>
> -Matteius
>
> On Jun 2, 4:05 am, Tom Evans  wrote:
> > On Thu, Jun 2, 2011 at 8:02 AM, maverick  wrote:
> > > We build a pretty cool website LOCQL (www.LOCQL.com) purely on Django
> > > and run on GAE has just went live!
> >
> > > I would say development with Django is purely enjoyable experience,
> > > however the Google Apps Engine does bring us some headache esp. we are
> > > a location based service, the geo-location related search is a
> > > challenge for us.
> >
> > > I would like everyone who use Django to give us a try and feedback are
> > > warmly welcome!
> >
> > Less a website and more a facebook plugin. I suggest you provide some
> > options for people who don't want to share their life with Zuckerberg.
> >
> > 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.
>
>

-- 
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: DEBUG=False issue

2011-06-02 Thread Casey Greene
You are probably registering your models for the admin section in 
models.py instead of an admin.py file.  This works in DEBUG where all of 
the models files but not when DEBUG is off.


https://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-objects

Hope this helps,
Casey

On 06/02/2011 02:23 PM, Bobby Roberts wrote:

hey -

i've got a weird issue with a django app.  The app runs great on both
the front end and in the /admin section when DEBUG=True in my
settings.py file.  However, whenever I set DEBUG=False in the settings
file so that i get tracebacks by email, the entire /admin section
404s.  Any idea what could be causing this?



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



DEBUG=False issue

2011-06-02 Thread Bobby Roberts
hey -

i've got a weird issue with a django app.  The app runs great on both
the front end and in the /admin section when DEBUG=True in my
settings.py file.  However, whenever I set DEBUG=False in the settings
file so that i get tracebacks by email, the entire /admin section
404s.  Any idea what could be causing this?

-- 
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: Our new startup site build on Django and GAE is now live!

2011-06-02 Thread Matteius
Yes I would appreciate a more integrated login approach or standard
accounts.  Facebook login is possible without having to give you
access to post to my wall.  Very restrictive in the current phase, but
looks interesting underneath the login request.

-Matteius

On Jun 2, 4:05 am, Tom Evans  wrote:
> On Thu, Jun 2, 2011 at 8:02 AM, maverick  wrote:
> > We build a pretty cool website LOCQL (www.LOCQL.com) purely on Django
> > and run on GAE has just went live!
>
> > I would say development with Django is purely enjoyable experience,
> > however the Google Apps Engine does bring us some headache esp. we are
> > a location based service, the geo-location related search is a
> > challenge for us.
>
> > I would like everyone who use Django to give us a try and feedback are
> > warmly welcome!
>
> Less a website and more a facebook plugin. I suggest you provide some
> options for people who don't want to share their life with Zuckerberg.
>
> 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: Seeking a Django 1.3 and syslog configuration example

2011-06-02 Thread Matteius
# Configure Project Logging using Django Logging setting and
specifying
# Dict-Config to Python 1.6
LOGGING = {
'version': 1,
'formatters': {
'simple': {
'format': '%(asctime)s %(levelname)s %(module)s [%(name)s]
- %(message)s \n',
},
'verbose': {
'format': '%(asctime)s %(levelname)s %(module)s %
(process)d %(thread)d %(message)s'
},
},
'handlers': {
'log_test': {
'class': 'logging.handlers.TimedRotatingFileHandler',
'filename': '/var/log/classcomm/log-test.log',
'when': 'H',
'interval': 1,
'backupCount': 5,
'formatter': 'simple',
},
'classcomm': {
'class': 'logging.handlers.TimedRotatingFileHandler',
'filename': '/var/log/classcomm/classcomm.log',
'when': 'H',
'interval': 1,
'backupCount': 5,
'formatter': 'verbose',
},
'student_portal': {
'class': 'logging.FileHandler',
'filename': '/var/log/classcomm/student_portal.log',
'mode': 'a',
'formatter': 'verbose',
},
'instructor_portal': {
'class': 'logging.FileHandler',
'filename': '/var/log/classcomm/instructor_portal.log',
'mode': 'a',
'formatter': 'verbose',
},
'django': {
'class': 'logging.FileHandler',
'filename': '/var/log/classcomm/django.log',
'mode': 'a',
'formatter': 'verbose',
},
'django_sql': {
'class': 'logging.FileHandler',
'filename': '/var/log/classcomm/django-sql.log',
'mode': 'a',
'formatter': 'verbose',
},
#'sentry_handler': {
#'class': 'sentry.client.handlers.SentryHandler',
#'formatter': 'verbose',
#},
#'stream_handler': {
#'class': 'logging.StreamHandler',
#'formatter': 'verbose',
#}
},
# Root logger (complete logging)
'root' : { 'level' : 'WARNING', 'handlers' : ['classcomm'], #,
'sentry_handler'],
},
'loggers': {
'log_test': { 'level': 'INFO', 'handlers': ['log_test'] },
'student_portal': { 'level': 'INFO', 'handlers':
['student_portal'] },
'instructor_portal': { 'level': 'INFO', 'handlers':
['instructor_portal'] },
'django': { 'handlers': ['django'] },
'django.core.urlresolvers': { 'level': 'DEBUG' },
'django.core.handlers.base': { 'level': 'DEBUG' },
'django.db.models.loading': { 'level': 'DEBUG' },
'django.db.backends.util': { 'level': 'DEBUG',
 'propagate': False,
 'handlers': ['django_sql'] },
# 'sentry.errors': { 'level': 'INFO', 'handlers':
['stream_handler'] },
},
}

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



Reasons to use managers

2011-06-02 Thread Amit Sethi
Hi all , I have a situation in which i am contemplating using an extra
field although the same thing can be done using a manager(although the
function may take some time). In this situation normalization isn't
actually a priority. Are there some other reasons to use a manager.
Also what would be the difference in terms of efficiency.

-- 
A-M-I-T S|S

-- 
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: Question about using imports within functions/methods

2011-06-02 Thread Cal Leeming [Simplicity Media Ltd]
On Thu, Jun 2, 2011 at 4:46 PM, Shawn Milochik  wrote:

> On 06/02/2011 11:09 AM, Cal Leeming [Simplicity Media Ltd] wrote:
>
>>
>> Pretty shameful that after almost 6 years of (fairly advanced) Python
>> coding, I still finding myself not knowing some of the basic 101 stuff..
>> Slightly off topic but, does anyone else have that issue when coding? (i.e.
>> doing really complex code, but forgetting/not knowing some of the real basic
>> stuff).
>>
>>
> Yeah, I run into that from time to time. What I do to remedy it is read
> books. Especially ones like the Python Essential Reference by David Beazley.
> Just scan through it in the bath or at breakfast or whatever, and you'll
> find a handy module you never knew existed, or a wonderful new feature in
> something you use all the time.
>
> I'm anxiously anticipating Doug Hellmann's new book on the standard
> library, which should ship sometime this month.
>http://amzn.com/0321767349
> From what I've read in his PyMoTW posts and seen in his PyCon presentation,
> this book will make my Python skills even better.
>

Sounds like a good idea, this is going in my todo list :)


>
> I suspect that most working developers are self-taught, in that they didn't
> learn the technology they work with from the ground up in a classroom --
> they picked it up as they went along. That's what I blame for the gaps in
> our knowledge. I don't think these books are the best place to start with
> Python, but they're a great way to sharpen the axe.
>

Yeah I'm completely self taught too, although it does mean my knowledge is
somewhat sparse. I think your above suggestion is a good way to tackle that
problem though. I guess it's like any job, every so often, you need to have
"refreshers" to make sure you are keeping up to scratch.


>
> Shawn
>
>
> --
> 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 1.3 docs PDF

2011-06-02 Thread tech tech
Oscar - thanks so much for this. Just a few hours ago, I was
frantically trying to download the django site offline in preparation
for two overnight train journeys from Bombay to Himachal Pradesh.

The internet is spotty at best whilst on the train, and it is
non-existent in the mountains of Himachal where I am headed for the
next ten days.

I agree with André - having links to official PDF's on the project
website would be very useful.

- Harshil

On 6/2/11, Andre Terra  wrote:
> I'm going to repeat myself and say +1 on having links to 'official' PDFs
> available somewhere in djangoproject.com.
>
>
> Sincerely,
> André Terra
>
> On Thu, Jun 2, 2011 at 1:07 AM, Oscar Carballal  wrote:
>
>> Didn't know that django had a page on readthedocs.org. But even when
>> the RTD API generates the same document, it has one fault, the content
>> index, sometimes it does not generate it (I've come up with this issue
>> when generating the PDF by hand using the RTD code, I had to run
>> pdflatex two times to get the contents).
>>
>> Anyway, thanks for pointing it! :-)
>>
>> 2011/6/2 Jacob Kaplan-Moss :
>> > On Wed, Jun 1, 2011 at 4:47 PM, Oscar Carballal 
>> wrote:
>> >> I've just created a PDF (5.6MB, 1042 pages) with all the django 1.3
>> >> docs [|], just in case someone need it (sometimes it's useful to have
>> >> the docs offline).
>> >
>> > Also see http://readthedocs.org/projects/django/, which has got links
>> > to PDF downloads for 1.3, 1.2, and development trunk.
>> >
>> > 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.
>
>

-- 
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: mod_wsgi on cPanel/WHM gets easier

2011-06-02 Thread Nan

Man, wish I had something like that a couple years ago.  Please keep
us posted on further developments!

On Jun 1, 12:08 pm, shacker  wrote:
> If you run a cPanel/WHM server, and have manually compiled mod_wsgi in
> the past, you know that updating apache/php for the rest of  your
> server is a pain, since the easy_apache build script is unaware of the
> custom mod_wsgi module and discards it during compilation. And since
> you have enabled mod_wsgi in your httpd.conf headers, the build script
> fails at the end of the process since it can no longer find the
> referenced module.
>
> All of this just got a lot easier - there is now an official mod_wsgi
> add-on for easy_apache, making the whole process wsgi-aware.
>
> http://code.google.com/p/modwsgi/issues/detail?id=214
>
> I have not yet tested it but early reports are positive.
>
> Also, if you want to see cPanel systems with native Django support
> (much like the native Rails support that's there now), please log your
> interest in this thread - official cPanel devs are watching and
> seeking input from the community about how it should work:
>
> http://forums.cpanel.net/f145/django-support-146541.html
>
> All of this may sound obscure, but the difficulty of deployment on
> standard web hosts is one of the biggest barriers to wider Django
> adoption. cPanel is the most common web hosting system in the world,
> period. Getting good Django support into WHM/cPanel would be great for
> Django's popularity.
>
> Scot

-- 
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: Question about using imports within functions/methods

2011-06-02 Thread Shawn Milochik

On 06/02/2011 11:09 AM, Cal Leeming [Simplicity Media Ltd] wrote:


Pretty shameful that after almost 6 years of (fairly advanced) Python 
coding, I still finding myself not knowing some of the basic 101 
stuff.. Slightly off topic but, does anyone else have that issue when 
coding? (i.e. doing really complex code, but forgetting/not knowing 
some of the real basic stuff).




Yeah, I run into that from time to time. What I do to remedy it is read 
books. Especially ones like the Python Essential Reference by David 
Beazley. Just scan through it in the bath or at breakfast or whatever, 
and you'll find a handy module you never knew existed, or a wonderful 
new feature in something you use all the time.


I'm anxiously anticipating Doug Hellmann's new book on the standard 
library, which should ship sometime this month.

http://amzn.com/0321767349
From what I've read in his PyMoTW posts and seen in his PyCon 
presentation, this book will make my Python skills even better.


I suspect that most working developers are self-taught, in that they 
didn't learn the technology they work with from the ground up in a 
classroom -- they picked it up as they went along. That's what I blame 
for the gaps in our knowledge. I don't think these books are the best 
place to start with Python, but they're a great way to sharpen the axe.


Shawn

--
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: Cleaned Data Different Access?

2011-06-02 Thread Robin
Daniel, I'm afraid it's just inexperience / ignorance that makes me
think that I was no longer dealing with a dictionary.  I saw get() and
went to the model in my mind.  I looked at the source code for the
forms module and it didn't seem that it was all of a sudden not a
dictionary, and your response helps clarify the issue.  Thank you very
much for your help.

I was reading the doc page, "Form and field validation" and saw the
difference in the two clean methods.  It tripped me up for a bit, but
I guess this different method of accessing clean_data makes good
sense.  It seems that clean_fieldname() will always return
cleaned_data for all fields; if the field didn't pass validation it
will still be returned as a python object, with the associated
error(s).  On the other hand, clean() for the form will only return
fields in cleaned_data that have passed all their validation.

One gets a hint of this from the documentation:

"The clean() method for the Form class or subclass is always run.  If
that method raises a ValidationError, cleaned_data will be an empty
dictionary.

The previous paragraph means that if you are overriding Form.clean(),
you should iterate through self.cleaned_data.items(), possibly
considering the _errors dictionary attribute on the form as well.  In
this way, you will already know which fields have passed their
individual validation requirements."

I think this could have been a bit more explicit, but I might not have
looked in the right spot for all the information.

Thanks again, Daniel.

Robin

Ah!  So, it the clean_fieldname method

On Jun 2, 2:32 am, Daniel Roseman  wrote:
> What makes you think that? .get() is a dictionary method. It's just useful 
> when you're not sure the specific key exists, which is the case in the 
> general clean() method.
> --
> DR.

-- 
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: Question about using imports within functions/methods

2011-06-02 Thread Cal Leeming [Simplicity Media Ltd]
Thanks to Tom / Matias / Brian for taking the time to reply, and for
providing some good links, this was *exactly* what I needed.

In regards to circular import issues, this is pretty much the main reason
I've put imports inside function/method before, and I agree that most of the
time it can be resolved with re-organization.

Pretty shameful that after almost 6 years of (fairly advanced) Python
coding, I still finding myself not knowing some of the basic 101 stuff..
Slightly off topic but, does anyone else have that issue when coding? (i.e.
doing really complex code, but forgetting/not knowing some of the real basic
stuff).

On Thu, Jun 2, 2011 at 3:56 PM, Brian Bouterse  wrote:

> Yes relative imports are explicitly discouraged in PEP 
> 8.
>  Look for the imports section.
>
> I do not recommend importing at runtime which is what you are doing when
> you put imports inside function/methods.  There are performance problems
> when calling imports repeatedly.  One possible method is to use a lazy
> import paradigm described at the end of this section on import 
> overhead
> .
>
> The only reason I think it is ok to do imports inside function/method code
> is if you don't know what you need to import until runtime, but in those
> cases you wouldn't use the standard "import foo" syntax, since you would
> need to dynamically choose what to import.
>
> Another reason folks hide imports inside function/method code is to solve
> circular import issues.  This is a consistently unproductive solution and
> will create problems over time through hidden import dependencies that
> aren't discovered until runtime.  circular imports can almost always be
> resolved through some code and package reorganization.  I like this
> article  on how import works
> in python.
>
> Brian
>
>
>
> On Thu, Jun 2, 2011 at 10:39 AM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> Hey guys,
>>
>> This is more of a python question, than a Django specific one, but it's
>> been bugging me for years now lol.
>>
>> I'm trying to figure out if it is better to do imports at the top of the
>> file, or within the function/methods themselves.
>>
>> I guess the questions I'm asking are:
>>
>>- Is there any (serious) performance issues by doing imports every
>>time the function/method is called
>>- Is there a preferred style / guideline when it comes to imports?
>>(maybe a PEP somewhere?)
>>- Are relative imports discouraged? (from .. import package)
>>
>> Obviously, the answers would depend on different scenarios, so I'm looking
>> for a discussion really, rather than a set in stone answer.
>>
>> Example 1:
>> import os
>> def test():
>>print os.uname()
>> def test2():
>>print os.uname()
>> test()
>> test2()
>>
>> Example 2:
>> import os
>> class test:
>>def test(self):
>>print os.uname()
>>
>>
>> Example 2:
>> class test:
>>def test(self):
>>import os
>>print os.uname()
>>def test2(self):
>>import os
>>print os.uname()
>>
>> t = test()
>> t.test()
>> t.test2()
>>
>>  --
>> 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.
>>
>
>
>
> --
> Brian Bouterse
> ITng Services
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



django apps

2011-06-02 Thread podio
Hi, where can i found django apps for learning, i'm trying to make the
management of a club, list of partners and collect monthly fees, I
have something make but I need lots of corrections

List only  RelationshipInline if the afiliado model have tipo_estitu =
True.
Export the list in every admin model to pdf and excel
and the fees app


models.py

#encodings UTF-8
from django.db import models

provincias = ((u'BA',u'Buenos Aires'),
 (u'CA',u'Catamarca'),
 (u'CH',u'Chaco'),
 (u'CU',u'Chubut'),
 (u'CO',u'Cordoba'),
 (u'CT',u'Corrientes'),
 (u'ER',u'Entre Rios'),
 (u'FO',u'Formosa'),
 (u'JU',u'Jujuy'),
 (u'LP',u'La Pampa'),
 (u'LR',u'La Rioja'),
 (u'ME',u'Mendoza'),
 (u'MI',u'Misiones'),
 (u'NE',u'Neuquen'),
 (u'RN',u'Rio Negro'),
 (u'SA',u'Salta'),
 (u'SJ',u'San Juan'),
 (u'SL',u'San Luis'),
 (u'SC',u'Santa Cruz'),
 (u'SF',u'Santa Fe'),
 (u'SE',u'Santiago del Estero'),
 (u'TF',u'Tierra del Fuego'),
 (u'TU',u'Tucuman'))

class obra_social(models.Model):
def __unicode__(self):
return self.descripcion
descripcion = models.CharField(max_length=200)
class Meta:
verbose_name_plural = "obras sociales"
verbose_name = "obra social"

class caracter(models.Model):
def __unicode__(self):
return self.descripcion
descripcion = models.CharField(max_length=200)
class Meta:
verbose_name_plural = "caracteres"

class tipo(models.Model):
def __unicode__(self):
return self.descripcion
descripcion = models.CharField(max_length=200)
cuota = models.DecimalField(max_digits=10, decimal_places=2)
estitu = models.BooleanField("Es titular")
class Meta:
verbose_name_plural = "tipos"

class afiliado(models.Model):
def __unicode__(self):
return self.nombre
nombre = models.CharField("Nombre",max_length=200)
FechaNac  = models.DateField("Fecha Nacimiento")
DOCN = models.CharField("Documento",max_length=20,blank =True)
Nacionalidad = models.CharField(max_length=50,default="Argentino")
obra_social = models.ForeignKey(obra_social)
caracter = models.ForeignKey(caracter)
tipo = models.ForeignKey(tipo)
Matricula = models.CharField(max_length=20)
FechaIng = models.DateField("Fecha Ingreso")
Direccion = models.CharField(max_length=100,blank =True)
CP = models.CharField(max_length=20,blank =True)
Ciudad = models.CharField(max_length=50)
Provincia = models.CharField(max_length=50, choices = provincias)
Tel1 = models.CharField(max_length=25,blank =True)
Tel2 = models.CharField(max_length=25,blank =True)
Email = models.EmailField(max_length=100,blank =True)
Observaciones = models.TextField(blank =True)
class Meta:
verbose_name_plural = "afiliados"

def calcular_edad(self):
import datetime
nac = str(self.FechaNac)
y,m,d = nac.split("-")
date = datetime.date(int(y),int(m),int(d))
delta = datetime.date.today() - date
try:
edad =  datetime.date.fromordinal(delta.days).year - 1
except:
edad = None
return edad

class Relationship(models.Model):
class Meta:
verbose_name = "Familiar"
verbose_name_plural = "Familiar"
parent = models.ForeignKey(afiliado, related_name='parents')
child = models.ForeignKey(afiliado, related_name='children')

-
admin.py

from afiliados.models import
afiliado,obra_social,caracter,tipo,Relationship
from django.contrib import admin

class RelationshipInline(admin.TabularInline):
model = Relationship
extra = 1
fk_name = 'parent'
raw_id_fields = ['child']

class AfiliadoAdmin(admin.ModelAdmin):
fieldsets = [
(None   ,{'fields':
['nombre','FechaNac','DOCN','Nacionalidad']}),
('Datos Generales'  ,{'fields':
['obra_social','caracter','tipo','Matricula','FechaIng']}),
('Datos de contacto',{'fields': ['Direccion',
("CP","Ciudad"),"Provincia","Tel1","Tel2","Email"]}),
(None   ,{'fields': ['Observaciones']}),
]
list_display = ('nombre',"tipo")
list_filter =
['Ciudad','caracter','tipo','obra_social','FechaNac']
search_fields = ['nombre','DOCN']
inlines = [RelationshipInline]

admin.site.register(afiliado,AfiliadoAdmin)
admin.site.register(obra_social)
admin.site.register(caracter)
admin.site.register(tipo)



I'm only have 4 day using django... and have a deadline.

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 

Re: Question about using imports within functions/methods

2011-06-02 Thread Matías Aguirre
Imports are cached by python that way things get imported only the first time.

Try this simple test, create a file a.py with this content:
print "Importing a.py"

Then create b.py with this other content:
import a

Then create c.py with this other content:
def x():
import a
pass

Open a python interpreter and do:
>>> import b

It should print "Importing a.py", do the import again, it shouldn't print
anything. Now close the interpreter and start a new one and do:
>>> import c
>>> c.x()
>>> c.x()
It should print "Importing a.py" only once too.

Anyway, I would suggest you to follow PEP8 guideline 
http://www.python.org/dev/peps/pep-0008/
and leave function level import for cases where recursive imports is an issue.

Good luck,
Matías

Excerpts from Cal Leeming [Simplicity Media Ltd]'s message of Thu Jun 02 
11:39:14 -0300 2011:
> Hey guys,
> 
> This is more of a python question, than a Django specific one, but it's been
> bugging me for years now lol.
> 
> I'm trying to figure out if it is better to do imports at the top of the
> file, or within the function/methods themselves.
> 
> I guess the questions I'm asking are:
> 
>- Is there any (serious) performance issues by doing imports every time
>the function/method is called
>- Is there a preferred style / guideline when it comes to imports? (maybe
>a PEP somewhere?)
>- Are relative imports discouraged? (from .. import package)
> 
> Obviously, the answers would depend on different scenarios, so I'm looking
> for a discussion really, rather than a set in stone answer.
> 
> Example 1:
> import os
> def test():
>print os.uname()
> def test2():
>print os.uname()
> test()
> test2()
> 
> Example 2:
> import os
> class test:
>def test(self):
>print os.uname()
> 
> 
> Example 2:
> class test:
>def test(self):
>import os
>print os.uname()
>def test2(self):
>import os
>print os.uname()
> 
> t = test()
> t.test()
> t.test2()
> 
-- 
Matías Aguirre 

-- 
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: Question about using imports within functions/methods

2011-06-02 Thread Tom Evans
On Thu, Jun 2, 2011 at 3:39 PM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> Hey guys,
>
> This is more of a python question, than a Django specific one, but it's been
> bugging me for years now lol.
>
> I'm trying to figure out if it is better to do imports at the top of the
> file, or within the function/methods themselves.
> I guess the questions I'm asking are:
>
> Is there any (serious) performance issues by doing imports every time the
> function/method is called
> Is there a preferred style / guideline when it comes to imports? (maybe a
> PEP somewhere?)
> Are relative imports discouraged? (from .. import package)
>

To quickly answer your Qs:

Yes, there is a slight cost in importing modules. Putting the import
in the function adds an infinitesimal cost to the function.
Imports are discussed in PEP 8 and relative imports in PEP 328.
Relative imports are strongly discouraged.

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: Question about using imports within functions/methods

2011-06-02 Thread Brian Bouterse
Yes relative imports are explicitly discouraged in PEP
8.
 Look for the imports section.

I do not recommend importing at runtime which is what you are doing when you
put imports inside function/methods.  There are performance problems when
calling imports repeatedly.  One possible method is to use a lazy import
paradigm described at the end of this section on import
overhead
.

The only reason I think it is ok to do imports inside function/method code
is if you don't know what you need to import until runtime, but in those
cases you wouldn't use the standard "import foo" syntax, since you would
need to dynamically choose what to import.

Another reason folks hide imports inside function/method code is to solve
circular import issues.  This is a consistently unproductive solution and
will create problems over time through hidden import dependencies that
aren't discovered until runtime.  circular imports can almost always be
resolved through some code and package reorganization.  I like this
articleon how import
works in python.

Brian



On Thu, Jun 2, 2011 at 10:39 AM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Hey guys,
>
> This is more of a python question, than a Django specific one, but it's
> been bugging me for years now lol.
>
> I'm trying to figure out if it is better to do imports at the top of the
> file, or within the function/methods themselves.
>
> I guess the questions I'm asking are:
>
>- Is there any (serious) performance issues by doing imports every time
>the function/method is called
>- Is there a preferred style / guideline when it comes to imports?
>(maybe a PEP somewhere?)
>- Are relative imports discouraged? (from .. import package)
>
> Obviously, the answers would depend on different scenarios, so I'm looking
> for a discussion really, rather than a set in stone answer.
>
> Example 1:
> import os
> def test():
>print os.uname()
> def test2():
>print os.uname()
> test()
> test2()
>
> Example 2:
> import os
> class test:
>def test(self):
>print os.uname()
>
>
> Example 2:
> class test:
>def test(self):
>import os
>print os.uname()
>def test2(self):
>import os
>print os.uname()
>
> t = test()
> t.test()
> t.test2()
>
>  --
> 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.
>



-- 
Brian Bouterse
ITng Services

-- 
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 about using imports within functions/methods

2011-06-02 Thread Cal Leeming [Simplicity Media Ltd]
Hey guys,

This is more of a python question, than a Django specific one, but it's been
bugging me for years now lol.

I'm trying to figure out if it is better to do imports at the top of the
file, or within the function/methods themselves.

I guess the questions I'm asking are:

   - Is there any (serious) performance issues by doing imports every time
   the function/method is called
   - Is there a preferred style / guideline when it comes to imports? (maybe
   a PEP somewhere?)
   - Are relative imports discouraged? (from .. import package)

Obviously, the answers would depend on different scenarios, so I'm looking
for a discussion really, rather than a set in stone answer.

Example 1:
import os
def test():
   print os.uname()
def test2():
   print os.uname()
test()
test2()

Example 2:
import os
class test:
   def test(self):
   print os.uname()


Example 2:
class test:
   def test(self):
   import os
   print os.uname()
   def test2(self):
   import os
   print os.uname()

t = test()
t.test()
t.test2()

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



DjangoCon US 2011: Call for Tutorial Proposals

2011-06-02 Thread Steve Holden
The DjangoCon US team is looking at running half-day tutorials for the first
time this year. We are therefore seeking proposals from well-qualified
speakers who would like to present tutorials on Monday, September 5. This
year we anticipate running at most four tutorials, though that number may be
exceeded if sufficient popular proposals are received. There is no
restriction on the topics that can be offered. Tutorial presenters will
receive a fee proportional to the size of their registered audience.

Selection will be by popularity: places at a maximum of ten tutorials
selected by the organizers will be offered for sale, and those attracting
most sales will run. Anyone who has subscribed to a non-running tutorial
will be offered a free transfer into the tutorial of their choice (subject
to availability) or a refund of their tutorial fees.

Since the conference web site has not yet been deployed please send your
proposals to steve at holdenweb dot com. I will also be happy to receive
suggestions from non-authors about the topics people would like to see
offered, either in reply to this email or to the address above.

regards
 Steve
-- 
Steve Holden+1 571 484 6266  +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

-- 
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: save out a test database?

2011-06-02 Thread Margie Roginski
Karen Tracy, if you are reading this, could you comment?

As the person that seems to be most knowledgable about django testing
(your Django 1.1 Testing book is fantastic - I highly recommend it!),
can you confirm that something like this is the best way to go?  It
seems strange to me that there is no more standard way of dumping the
database from inside a test so that the state can be replicated for
use in a runserver environment.

Margie

On Jun 1, 2:01 pm, Kirill Spitsin  wrote:
> On Wed, Jun 01, 2011 at 11:59:28AM -0700, Margie Roginski wrote:
> > That's a good pointer, thanks.  However I'm still confused about how I
> > can actually dump out the data from my test run?  For example, say I
> > have a particular test and I want to dump the data at some certain
> > point.  I can put in pdb.set_trace() in the code to stop at the
> > appropriate point, but what do I call from that point to create the
> > mydata.json file that then gets loaded with the command
>
> >   django-admin.py testserver mydata.json
> >>> from django.core.serializers import serialize
> >>> queryset1 = Model1.objects.filter(...)
> >>> queryset2 = Model2.objects.filter(...)
> >>> fixture = serialize('json', list(queryset1) + list(queryset2))
> >>> f = open('mydate.json', 'w')
> >>> f.write(fixture)
> >>> f.close()
>
> --
> Kirill Spitsin

-- 
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: howto remove request.GET parameter

2011-06-02 Thread ozgur yilmaz
I realized that, there's nothing wrong with the removing code. The
problem is the return statement. when the dictionary req is empty the
def returns u"" and somehow old request.GET remains unchanged. So i
should return a specific value, when the dictionary req is null.

2011/6/2 ozgur yilmaz :
> Hi,
>
> I have a custom templatetag function like this:
>
> @register.filter(name='rem_get_request')
> def rem_get_request(getrequest,name):
>        req = getrequest.copy()
>
>        for get_item in name.split('&'):
>                if get_item in req and req[get_item]:
>                        get_item = get_item.strip()
>                        del req[get_item]
>
>        if req:
>                return u"?%s" % (req.urlencode())
>        return u""
>
> "getrequest" parameter is request.GET
> and "name" parameter is the parameters to be removed, splitted by '&'
> (ampersand) (ie "min_price_price" )
>
> The problem is:
> If request.GET has more than 1 parameter (
> ?tag=mytag_price=1000_price=1500 ) i can remove one or more
> parameters. But if request.GET contains only one parameter (
> ?tag=mytag ) then it doesnt work. the "if" statement works, but "del"
> doesnt work. i cannot remove this last parameter. What am i doing
> wrong?
>
> Thanks for your information.
>

-- 
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: Circular import on every backend except sqlite

2011-06-02 Thread Tom Evans
On Thu, Jun 2, 2011 at 12:44 PM, Gloria W  wrote:
> I am experiencing this:
> https://code.djangoproject.com/ticket/16136
> and the only way I can prevent it is by using sqlite.
> Does anyone have a patch for this, or more info?
> Thank you in advance,
> Gloria
>

WFM, + everyone else. Reinstall django, I don't believe (looking at
that ticket) that it is installed properly.

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.



Circular import on every backend except sqlite

2011-06-02 Thread Gloria W
I am experiencing this:
https://code.djangoproject.com/ticket/16136
and the only way I can prevent it is by using sqlite.
Does anyone have a patch for this, or more info?
Thank you in advance,
Gloria

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



howto remove request.GET parameter

2011-06-02 Thread ozgur yilmaz
Hi,

I have a custom templatetag function like this:

@register.filter(name='rem_get_request')
def rem_get_request(getrequest,name):
req = getrequest.copy()

for get_item in name.split('&'):
if get_item in req and req[get_item]:
get_item = get_item.strip()
del req[get_item]

if req:
return u"?%s" % (req.urlencode())
return u""

"getrequest" parameter is request.GET
and "name" parameter is the parameters to be removed, splitted by '&'
(ampersand) (ie "min_price_price" )

The problem is:
If request.GET has more than 1 parameter (
?tag=mytag_price=1000_price=1500 ) i can remove one or more
parameters. But if request.GET contains only one parameter (
?tag=mytag ) then it doesnt work. the "if" statement works, but "del"
doesnt work. i cannot remove this last parameter. What am i doing
wrong?

Thanks for your information.

-- 
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 1.3 docs PDF

2011-06-02 Thread Andre Terra
I'm going to repeat myself and say +1 on having links to 'official' PDFs
available somewhere in djangoproject.com.


Sincerely,
André Terra

On Thu, Jun 2, 2011 at 1:07 AM, Oscar Carballal  wrote:

> Didn't know that django had a page on readthedocs.org. But even when
> the RTD API generates the same document, it has one fault, the content
> index, sometimes it does not generate it (I've come up with this issue
> when generating the PDF by hand using the RTD code, I had to run
> pdflatex two times to get the contents).
>
> Anyway, thanks for pointing it! :-)
>
> 2011/6/2 Jacob Kaplan-Moss :
> > On Wed, Jun 1, 2011 at 4:47 PM, Oscar Carballal 
> wrote:
> >> I've just created a PDF (5.6MB, 1042 pages) with all the django 1.3
> >> docs [|], just in case someone need it (sometimes it's useful to have
> >> the docs offline).
> >
> > Also see http://readthedocs.org/projects/django/, which has got links
> > to PDF downloads for 1.3, 1.2, and development trunk.
> >
> > 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: Template - counter for if loop

2011-06-02 Thread Tim Shaffer
I think you might want the heading outside the loop:

My Heading 
{% for val in data %} 
 {% ifnotequal val 2 %} 
 {{val}}  
 {% endifnotequal  %} 
{% endfor %} 

-- 
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/-/N2w4UTFHTUxSSjBK.
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: Confusion about DJANGO_SETTINGS_MODULE

2011-06-02 Thread Kenneth Gonsalves
On Thu, 2011-06-02 at 05:29 -0700, Kann wrote:
> Thanks Oscar, I read the page already, but am still not totally
> understood. The page said the value of DJANGO_SETTINGS_MODULE should
> be "Python path syntax", e.g.  mysite.settings. What exactly is
> "Python path syntax"? Would it be ok if I just provide the value as a
> file name? Perhaps, "new_setting.py"? 

assume that you have a directory called 'mysite'. In this directory you
will have to have an empty file called __init__.py. Then any file in
that directory with a 'py' extension can be imported leaving out the
extension. For example, foo.py can be imported as mysite.foo instead of
mysite/foo. For this to work, 'mysite' should be on the python path.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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: Confusion about DJANGO_SETTINGS_MODULE

2011-06-02 Thread Kirill Spitsin
On Thu, Jun 02, 2011 at 05:29:01AM -0700, Kann wrote:
> Thanks Oscar, I read the page already, but am still not totally
> understood. The page said the value of DJANGO_SETTINGS_MODULE should
> be "Python path syntax", e.g.  mysite.settings. What exactly is
> "Python path syntax"? Would it be ok if I just provide the value as a
> file name? Perhaps, "new_setting.py"?

"new_setting"

And i would recommend you read this part of python tutorial:

http://docs.python.org/tutorial/modules.html

-- 
Kirill Spitsin

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



Template - counter for if loop

2011-06-02 Thread jai_python
I need to show the heading only one time when forloop executed along
with if-loop;
example:
-
data.html
--

{% for val in data %}
 {% ifnotequal val 2 %}
 My Heading
 {{val}} 
 {% endifnotequal  %}
{% endfor %}

Input

data=[1,2,3,4,5,2,6]

Excepted Out put:
---

My heading
1
3
4
5
6

Here "My Heading" shouldn't repeat and it should occur one time. We
can't use forloop.counter/first, since we have a if-loop condition .

Pl let me know how to implement it.

Thanks & Regards,
Jai

-- 
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: Confusion about DJANGO_SETTINGS_MODULE

2011-06-02 Thread Kann
Thanks Oscar, I read the page already, but am still not totally
understood. The page said the value of DJANGO_SETTINGS_MODULE should
be "Python path syntax", e.g.  mysite.settings. What exactly is
"Python path syntax"? Would it be ok if I just provide the value as a
file name? Perhaps, "new_setting.py"?

Kann

On Jun 2, 2:03 pm, Oscar Carballal  wrote:
> 2011/6/2 Kann :
>
> > Yep, but what if I just want to load all configurations from the
> > entirely new file. What should be the proper value for me to give to
> > the DJANGO_SETTINGS_MODULE?
>
> Take a look tohttps://docs.djangoproject.com/en/dev/topics/settings/
>
> You can load the new settings via "runserver
> --settings=new_settings_file.py or in production stablishing the
> DJANGO_SETTINGS_PATH from the WSGI server.

-- 
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: Internationalization in Django.

2011-06-02 Thread Martin Brochhaus
There are dozens of approaches for this:

http://djangopackages.com/grids/g/model-translation/

Most of them are old, not documented, outdated, abandonned or just slow.
The newest player in this field is django-nani and I would recommend you to 
give it a try!

Best regards,
Martin

-- 
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/-/NUYyWDZNMm1yWGdK.
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: Odp: Re: signals pre_save vs model's save()

2011-06-02 Thread Malcolm Box
On 29 May 2011, at 15:53, Mateusz Harasymczuk wrote:

> W dniu niedziela, 29 maja 2011, 15:36:13 UTC+2 użytkownik Malcolm Box napisał:
> On 28 May 2011 11:05, Mateusz Harasymczuk  wrote:
> I am thinking about splitting my model's save() method over few signals.
> 
> For example, stripping spaces and making string capitalized.
> 
> 
> Why would you want to do that?
> 
> Because I am writing CRM, and my end users are non-technical ladies :}
> And each one of them inputs data in different format (id numbers, phone 
> numbers, dates, names [upper cased, capitalized, lower cased])
> Therefore I have to normalize an input to store, and then print contract 
> agreements in normalized way.
> You may say normalize via template tags at rendering level.
> Yes, but I use those data for example to calculate date ranges and text 
> search.
> If someone has an resignation addendum I have to make some other changes to 
> model.
> It is easier to normalize them in pre_save or at the save() method

I understand why you might want to clean up data, or have other processing on 
saving. I have no idea why you'd want to do that using signals rather than 
making things explicit in the model file.

> 
> If this logic is tied to your model, what is the advantage of moving it out 
> of the save() method in your model definition?  
> You would more usefully serve the same purpose by decomposing the save() 
> method into several functions e.g.:
> 
> my largest model is about 20 fields length.
> where save methods are about at least 50 lines long.
> 
> it gives me a mess.
> 

Is your problem that you've got 50 lines of code, or that you've got one 
function that's 50 lines long? If it's the function length that's a problem, 
then split the function up. Functions (including save()) can call other ones.

> and then there are list_display functions (each is 1 to 3 lines long) which 
> almost doubles fields length and gives me a 150-200 lines length model file, 
> with only 20 fileds
> 

If you have a lot of functionality to implement, you will end up with lots of 
lines of code. The art is in keeping the code organised so that you minimise 
the amount of code you have to look at at any one point.

> and I have not included comments and docstrings...
> 
Well you should probably have some of both :)
> 
> 
> Clean, simple and makes it very obvious what you're doing in the save() 
> method. Compare that with the signals version, which will give someone 
> reading the code no clue at all that when they call save() the values of the 
> fields will change.
> 
> I can provide a comment in a model file, that normalize functions are stored 
> in signals file.
>  

If you don't like having the functions in the model file, then move them into a 
separate .py file and import them into the models file. There's no need to use 
signals.


> I am not saying this is a good approach,
> I am thinking this might be a good solution in my case.
> 

Signals are designed to allow you to react to stuff happening in code that's 
unrelated to yours - not to allow you to stick a whole bunch of arbitrary 
processing into the middle of the save() routine for your own models.

> Looking forward to hearing some more opinions.
> I might reconsider, if someone points me a better solution, than I am 
> thinking of.
> 

Here's the right solution

utils.py:

def capitalise():
   

def other_stuff():
   .

models.py

from utils import capitalise, other_stuff,...

class MyModel(..):
 field1 = models.CharField()
def save(self, *args, **kwargs):
self.field1 = capitalise(self.field1)
self.field1 = other_stuff(self.field1)
super(MyModel, self).save(*args, **kwargs)


Except for the explicit calls to the capitalise()/other_stuff() functions in 
the save() method, this code is organised exactly like your proposed signals 
version, but it has the following advantages:

- It makes it explicit what processing is being done to the model on save()
- It makes the *ordering* of processing explicit - signals don't offer that

By all means go down the signals route if you want, it's your code. But you 
will then have two problems: your original one, and using signals.

HTH,

Malcolm

-- 
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: Confusion about DJANGO_SETTINGS_MODULE

2011-06-02 Thread Oscar Carballal
2011/6/2 Kann :

> Yep, but what if I just want to load all configurations from the
> entirely new file. What should be the proper value for me to give to
> the DJANGO_SETTINGS_MODULE?

Take a look to https://docs.djangoproject.com/en/dev/topics/settings/

You can load the new settings via "runserver
--settings=new_settings_file.py or in production stablishing the
DJANGO_SETTINGS_PATH from the WSGI server.

-- 
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: Disable debug logging for django.db.backends?

2011-06-02 Thread Malcolm Box
Alternatively, configure your logging handlers to send the db logging somewhere 
else (ie another file), and not to pass it on.

So in settings.py have:

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file_logging': {
'level' : 'DEBUG',
'class' : 'logging.handlers.RotatingFileHandler',
'backupCount' : 5,
'maxBytes': 500,
'filename': 'django.log'
},
'db_logging': {
'level' : 'DEBUG',
'class' : 'logging.handlers.RotatingFileHandler',
'backupCount' : 5,
'maxBytes': 500,
'filename': 'django-db.log'
},
},

'loggers': {
'django' : {
'handlers': ['file_logging'],
'level' : 'DEBUG',
'propagate' : False,
},
'django.db' : {
'handlers' : ['db_logging'],
'level' : 'DEBUG',
'propagate': False,
},
}

Which should send your db logs just to the django-db.log file.

HTH,

Malcolm

On 30 May 2011, at 18:11, Nathan Duthoit wrote:

> It's more of a hack than a clean solution but it works. Add the
> following to your settings file:
> 
>import logging
>logging.getLogger('django.db.backends').setLevel(logging.ERROR)
> 
> On May 24, 12:32 am, diafygi  wrote:
>> Howdy all,
>> 
>> I have DEBUG=True in my settings.py, and I have several logging
>> entries in my project (Django 1.3)
>> 
>> However, when I am testing, there are tons of django.db.backends debug
>> entries that appear, and my logs gets lost in the shuffle.
>> 
>> Is there a way to disable django.db.backends in my settings.py? What
>> is an example?
>> 
>> Thanks,
>> Daniel
> 
> -- 
> 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: Confusion about DJANGO_SETTINGS_MODULE

2011-06-02 Thread Kann


> You can import "setting_new.py" from "settings.py", that way you still
> only need to stablish settings.py as the DJANGO_SETTINGS_MODULE.

Yep, but what if I just want to load all configurations from the
entirely new file. What should be the proper value for me to give to
the DJANGO_SETTINGS_MODULE?

> To know more about the python PATH take a look to the "sys" module in
> the python documentation[1] exactrly the method "sys.path" :)
>
> [1]http://docs.python.org/library/sys.html

Thanks for the link. I am reading it now. :)

Kann

On Jun 2, 1:14 pm, Oscar Carballal  wrote:
> You can import "setting_new.py" from "settings.py", that way you still
> only need to stablish settings.py as the DJANGO_SETTINGS_MODULE.
>
> It's strange though, the development server of django (python
> manage.py runserver) should import automatically the settings module
> and add it to the python path.
>
> To know more about the python PATH take a look to the "sys" module in
> the python documentation[1] exactrly the method "sys.path" :)
>
> [1]http://docs.python.org/library/sys.html
>
> 2011/6/2 Kann :
>
>
>
>
>
>
>
> > Dear all,
>
> > In order to run django on the server, I need to specify the file
> > containing all the configuration and export it as a system variable
> > called "DJANGO_SETTINGS_MODULE". Also, the documentation on django
> > project website also stated that the value of DJANGO_SETTINGS_MODULE
> > should be in "Python path syntax". I am just Python newbie and don't
> > really know what format the Python path syntax should be. Here is my
> > case:
>
> > The default setting file is "settings.py"; so, now, my
> > DJANGO_SETTINGS_MODULE is configured as "settings"
>
> > However, if I want to create a new additional setting file such as
> > "setting_new.py", should the DJANGO_SETTINGS_MODULE be configured as
> > "setting_new.settings?
>
> > Kann
>
> > --
> > 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 
> > athttp://groups.google.com/group/django-users?hl=en.

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



Re: How to create user on mobile app for Django site?

2011-06-02 Thread Malcolm Box
On 31 May 2011, at 12:35, Ivo Brodien wrote:

> What is the correct way to do the following:
> 
> 1) Mobile App from which a user can create a user/profile on the Django site
> 2) Allow authenticated users to create on the site and query personalized 
> data from the site
> 
> This is what I guess I have to do:
> 
> 1) Create a REST API  (probably with e.g. django-piston) on at the Django 
> site for creation and authentication 
> 
There's no one correct way, but that way will work well. I've done something 
similar in the past and had mobile clients working across pretty much all phone 
platforms.

> How would I authenticate against the Django site?

Your choices are either to use username/passwords or OAuth. If you're using 
username/passwords you can hook straight into the standard Django 
authentication - just have your code do a POST to /admin/login with 
username/password. That's not massively secure, so you might want to consider 
doing it over SSL.

> When I use URL connections from the mobile app do I always have to send the 
> credentials or can the Django site identify me by storing session cookies on 
> the client just like as if the mobile app would be a browser?
> 
You can use session cookies just as on the desktop - the iPhone NSURLRequest 
will handle cookies for you. This is true on most platforms, the only place 
I've found where it doesn't work consistently is on Flash.

Of course if you choose to do OAuth then you simply sign each authenticated 
request. This works really well if you want to do some authenticated and some 
unauthenticated requests.

Malcolm

-- 
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: Internationalization in Django.

2011-06-02 Thread Kenneth Gonsalves
On Thu, 2011-06-02 at 16:46 +0530, Anand Agarwal wrote:
> problem with inserting new column is everytime you add support for new
> language, you need to insert one more column, which is messy. 

there is no other way afaik
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

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



Internationalization in Django.

2011-06-02 Thread Anand Agarwal
Hi All

we are trying to translate our website in french. Django has a good
framework for internationalization. Only problem is django model
translation. Is there a good way to handle django model translation, without
inserting new columns in data table?

problem with inserting new column is everytime you add support for new
language, you need to insert one more column, which is messy.

Would appreciate your reply.

Regards
Anand
http://bootstraptoday.com

-- 
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: Confusion about DJANGO_SETTINGS_MODULE

2011-06-02 Thread Oscar Carballal
You can import "setting_new.py" from "settings.py", that way you still
only need to stablish settings.py as the DJANGO_SETTINGS_MODULE.

It's strange though, the development server of django (python
manage.py runserver) should import automatically the settings module
and add it to the python path.

To know more about the python PATH take a look to the "sys" module in
the python documentation[1] exactrly the method "sys.path" :)

[1] http://docs.python.org/library/sys.html

2011/6/2 Kann :
> Dear all,
>
> In order to run django on the server, I need to specify the file
> containing all the configuration and export it as a system variable
> called "DJANGO_SETTINGS_MODULE". Also, the documentation on django
> project website also stated that the value of DJANGO_SETTINGS_MODULE
> should be in "Python path syntax". I am just Python newbie and don't
> really know what format the Python path syntax should be. Here is my
> case:
>
> The default setting file is "settings.py"; so, now, my
> DJANGO_SETTINGS_MODULE is configured as "settings"
>
> However, if I want to create a new additional setting file such as
> "setting_new.py", should the DJANGO_SETTINGS_MODULE be configured as
> "setting_new.settings?
>
> Kann
>
> --
> 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.



Confusion about DJANGO_SETTINGS_MODULE

2011-06-02 Thread Kann
Dear all,

In order to run django on the server, I need to specify the file
containing all the configuration and export it as a system variable
called "DJANGO_SETTINGS_MODULE". Also, the documentation on django
project website also stated that the value of DJANGO_SETTINGS_MODULE
should be in "Python path syntax". I am just Python newbie and don't
really know what format the Python path syntax should be. Here is my
case:

The default setting file is "settings.py"; so, now, my
DJANGO_SETTINGS_MODULE is configured as "settings"

However, if I want to create a new additional setting file such as
"setting_new.py", should the DJANGO_SETTINGS_MODULE be configured as
"setting_new.settings?

Kann

-- 
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: adding objects via admin section from ipad/iphone

2011-06-02 Thread Tom Evans
On Thu, Jun 2, 2011 at 9:06 AM, i...@webbricks.co.uk
 wrote:
> i think that approach is a little advanced for me, im not sure where
> id start!
>
> why would he need reeducating?
>
> Matt
>

Converting a wordpress web service call into the equivalent action for
your own CMS sounds a lot simpler to me than writing an ipad app for
submitting to your CMS.

Your client should be re-educated to not change requirements during
implementation just because of shiny things.


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: Our new startup site build on Django and GAE is now live!

2011-06-02 Thread Tom Evans
On Thu, Jun 2, 2011 at 8:02 AM, maverick  wrote:
> We build a pretty cool website LOCQL (www.LOCQL.com) purely on Django
> and run on GAE has just went live!
>
> I would say development with Django is purely enjoyable experience,
> however the Google Apps Engine does bring us some headache esp. we are
> a location based service, the geo-location related search is a
> challenge for us.
>
> I would like everyone who use Django to give us a try and feedback are
> warmly welcome!
>

Less a website and more a facebook plugin. I suggest you provide some
options for people who don't want to share their life with Zuckerberg.

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.



Cleaned Data Different Access?

2011-06-02 Thread Daniel Roseman
What makes you think that? .get() is a dictionary method. It's just useful when 
you're not sure the specific key exists, which is the case in the general 
clean() method.
-- 
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/MEhocE5DUzl1ZzBK.
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: adding objects via admin section from ipad/iphone

2011-06-02 Thread i...@webbricks.co.uk
i think that approach is a little advanced for me, im not sure where
id start!

why would he need reeducating?

Matt

On Jun 1, 4:39 pm, Tom Evans  wrote:
> On Wed, Jun 1, 2011 at 4:07 PM, i...@webbricks.co.uk
>
>
>
>
>
>  wrote:
> > i wonder if anyone has any suggestions around this issue.
>
> > I'm using zinnia blog engine in a couple of sites. customer has had
> > his head turned by an SEO genius (!) who reckons wordpress is far
> > better for google search results than zinnia. customer starts thinking
> > about moving back to wordpress. im not too chuffed about this.
> > customer starts playing with wordpress and realises he can use his
> > ipad/iphone (via bespoke apps) to create blog posts. tries on his
> > zinnia blog, no can do. this is because the choose file buttons in the
> > forms are greyed out, since you cant just access the ipads filesystem.
>
> > the wordpress apps are native on the device so know how to get into
> > the photo library to upload images.
>
> > so if i wanted to be able to create a blog post on the ipad, im
> > looking at having to create a custom app and getting it through the
> > app store.
>
> > unless there is some framework like phone gap that allows access?
>
> > has anyone come ancross and solved this issue before?
>
> I would have thought it would be easier to mimic wordpress's web
> service API, and re-use the same app, than to write a new app.
>
> Alternatively, send your customer for re-education.
>
> 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: Is there an HTML editor that's Django-aware

2011-06-02 Thread Derek
On May 31, 3:26 pm, Tom Evans  wrote:
> On Mon, May 30, 2011 at 2:41 PM, Jacob Kaplan-Moss  wrote:
> > On Monday, May 30, 2011, BobX  wrote:
> >> If anyone from the Django Project itself is listening then can I (very
> >> humbly) suggest that some editor recommendations would make a real
> >> fine addition to the info on the site (useful to n00b's like me
> >> anyway).
>
> > That's a good idea - thanks!
>
> > Where do you think such information should live? That is, at what
> > point in your process of learning Django would information about
> > editors have been helpful? Somewhere in the tutorial, or after?
> > Before?
>
> > Thanks,
>
> > Jacob
>
> The wording on this should be very careful. The default answer to
> 'what editor should I use to develop with Django' should be 'the one
> that you know how to use and are comfortable using'.
>

"We shouldn't be suggesting that there are a couple of 'correct'
choices, but perhaps providing hints and tips on how to fully use
certain popular editors with Django, eg how to correctly enable syntax
highlighting for django templates in various editors."

I agree - the point the OP was making needs to be made clear in the
descriptions i.e. identify which editors have support for Python &
Django syntax (either directly or via third-party add-ons).  It also
needs to be made clear that there is no "best" or "required" editor.

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



Our new startup site build on Django and GAE is now live!

2011-06-02 Thread maverick
We build a pretty cool website LOCQL (www.LOCQL.com) purely on Django
and run on GAE has just went live!

I would say development with Django is purely enjoyable experience,
however the Google Apps Engine does bring us some headache esp. we are
a location based service, the geo-location related search is a
challenge for us.

I would like everyone who use Django to give us a try and feedback are
warmly welcome!

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