Re: Do you combine you Django decorators?

2011-04-04 Thread Sam Walters
Hi Andy

I dont combine them... however:
I was using a couple of decorators for almost every view in one
project. Ended up putting them in middleware.
Are these decorators for every view? Maybe you should consider middleware too.

cheers

sam_w

On Mon, Apr 4, 2011 at 3:26 AM, andy  wrote:
> Do you use several Django decorators for your views or do you combine
> the common ones into one or two custom decorators?
>
> This is just something that I have been a bit curious about for a
> while now as I tend to hate using more that one decorator per view. I
> have often thought about combining them. Thought I have not done so as
> yet. I hate looking at it but it seem more flexible nonetheless.
>
> --
> 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.



Johnny Cache on Django 1.3

2011-04-04 Thread Charlie Offenbacher
Hi everyone!

I'm try to install johnny-cache on Django 1.3. I literally followed
the instructions here (http://packages.python.org/johnny-cache/#)
exactly, using the memcached version.

Evverything runs okay, but nothing gets cached at all when I telnet to
memcached. When I used cache-machine, that worked fine, so I know my
memcached installation works.

Any suggestions on how to debug this problem?

Thanks for your time!!
~Charlie

-- 
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: Read write config from a file. How?

2011-04-04 Thread Roberto De Ioris

On Apr 3, 4:31 am, hollando  wrote:
> Yes. Thanks for your replies.
>
> I have one more question. I want to put all my configures into one
> file and pass the file name by command line.
> My django is deployed as in uwsgi, so I pass the command line by --
> pyargv '-c /etc/myconfig.ini'.
> In django, how can I retrieve this command line file name? If I set it
> by os.enviroment, how to retrieve it?
> Thanks.
>

Hi, why not using the embedded uWSGI config parser ?

You can put all the uWSGI option in a ini file with your custom
options:

[uwsgi]
; uwsgi related options
socket = :3031
module = django.core.handlers.wsgi:WSGIHandler()
master = 1
; and here your custom options
my_funny_option = pluto
foo = bar


The in your code you can access all the options with the uwsgi.opt
dictionary:

import uwsgi

uwsgi.opt['socket']
uwsgi.opt['my_funny_option']

--
Roberto De Ioris
http://unbit.it

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



django-admin.py startproject mysite

2011-04-04 Thread Santiago Caracol
Hello,

the Django (1.3) tutorial says:

>From the command line, cd into a directory where you’d like to store
your code, then run the command django-admin.py startproject mysite.
This will create a mysite directory in your current directory.

When I run

django-admin.py startproject mysite,

I get this error:

Unknown command: 'startproject'
Type 'django-admin.py help' for usage.


Using django-admin.py help, I get these subcommands:

Available subcommands:
  changepassword
  cleanup
  collectstatic
  compilemessages
  createcachetable
  createsuperuser
  dbshell
  diffsettings
  dumpdata
  findstatic
  flush
  inspectdb
  loaddata
  makemessages
  reset
  runfcgi
  runserver
  shell
  sql
  sqlall
  sqlclear
  sqlcustom
  sqlflush
  sqlindexes
  sqlinitialdata
  sqlreset
  sqlsequencereset
  startapp
  syncdb
  test
  testserver
  validate

Does the Django tutorial still match reality?

Santiago

-- 
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: Johnny Cache on Django 1.3

2011-04-04 Thread Daniel Hilton
On 4 April 2011 08:16, Charlie Offenbacher
 wrote:
> Hi everyone!
>
> I'm try to install johnny-cache on Django 1.3. I literally followed
> the instructions here (http://packages.python.org/johnny-cache/#)
> exactly, using the memcached version.
>
> Evverything runs okay, but nothing gets cached at all when I telnet to
> memcached. When I used cache-machine, that worked fine, so I know my
> memcached installation works.
>
> Any suggestions on how to debug this problem?
>
> Thanks for your time!!
> ~Charlie
>
> --
> 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.
>
>

If you read the docs (http://packages.python.org/johnny-cache/) on
pypi  there is a reference to the incompatibility and the cause of the
problem.

Cheers,
Dan



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


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



Re: django-admin.py startproject mysite

2011-04-04 Thread Jiten Singh
Hi Santiago,

I think there is some problem in your installation of Django 1.3 , i
installed it myself and there is no problem with

*django-admin.py startproject mysite*

even the help of django-admin-py lists startproject command

I think  re-installation can work.



*Best Regards,
Jitendra
_discover the power of opensource*


On Mon, Apr 4, 2011 at 1:41 PM, Santiago Caracol  wrote:

> Hello,
>
> the Django (1.3) tutorial says:
>
> From the command line, cd into a directory where you’d like to store
> your code, then run the command django-admin.py startproject mysite.
> This will create a mysite directory in your current directory.
>
> When I run
>
> django-admin.py startproject mysite,
>
> I get this error:
>
> Unknown command: 'startproject'
> Type 'django-admin.py help' for usage.
>
>
> Using django-admin.py help, I get these subcommands:
>
> Available subcommands:
>  changepassword
>  cleanup
>  collectstatic
>  compilemessages
>  createcachetable
>  createsuperuser
>  dbshell
>  diffsettings
>  dumpdata
>  findstatic
>  flush
>  inspectdb
>  loaddata
>  makemessages
>  reset
>  runfcgi
>  runserver
>  shell
>  sql
>  sqlall
>  sqlclear
>  sqlcustom
>  sqlflush
>  sqlindexes
>  sqlinitialdata
>  sqlreset
>  sqlsequencereset
>  startapp
>  syncdb
>  test
>  testserver
>  validate
>
> Does the Django tutorial still match reality?
>
> Santiago
>
> --
> 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.



model refuses to save when manytomany field is blank

2011-04-04 Thread Kenneth Gonsalves
hi,

i have a model like this:
class Incident(models.Model):

escalate = models.IntegerField()
escalatelist =
models.ManyToManyField(Escalatelist,null=True,blank=True)

other fields removed for clarity. If I save this in admin, I get this
error:
'Incident' instance needs to have a primary key value before a
many-to-many relationship can be used.

the full traceback is:

Environment:


Request Method: POST
Request URL: http://127.0.0.1:8999/admin/incident/incident/add/

Django Version: 1.3 SVN-15966
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'employee',
 'incident']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py" in
get_response
  111. response = callback(request,
*callback_args, **callback_kwargs)
File "/usr/lib/python2.6/site-packages/django/contrib/admin/options.py"
in wrapper
  306. return self.admin_site.admin_view(view)(*args,
**kwargs)
File "/usr/lib/python2.6/site-packages/django/utils/decorators.py" in
_wrapped_view
  90. response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/django/views/decorators/cache.py"
in _wrapped_view_func
  75. response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/django/contrib/admin/sites.py" in
inner
  197. return view(request, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/django/utils/decorators.py" in
_wrapper
  25. return bound_func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/django/utils/decorators.py" in
_wrapped_view
  90. response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/django/utils/decorators.py" in
bound_func
  21. return func(self, *args2, **kwargs2)
File "/usr/lib/python2.6/site-packages/django/db/transaction.py" in
inner
  211. return func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/django/contrib/admin/options.py"
in add_view
  863. if form.is_valid():
File "/usr/lib/python2.6/site-packages/django/forms/forms.py" in
is_valid
  121. return self.is_bound and not bool(self.errors)
File "/usr/lib/python2.6/site-packages/django/forms/forms.py" in
_get_errors
  112. self.full_clean()
File "/usr/lib/python2.6/site-packages/django/forms/forms.py" in
full_clean
  269. self._post_clean()
File "/usr/lib/python2.6/site-packages/django/forms/models.py" in
_post_clean
  331. self.instance.clean()
File "/home/lawgon/servicefirst/incident/models.py" in clean
  182. if not self.escalatelist:
File
"/usr/lib/python2.6/site-packages/django/db/models/fields/related.py" in
__get__
  731. reverse=False
File
"/usr/lib/python2.6/site-packages/django/db/models/fields/related.py" in
__init__
  493. raise ValueError("%r instance needs to have a
primary key value before a many-to-many relationship can be used." %
instance.__class__.__name__)

Exception Type: ValueError at /admin/incident/incident/add/
Exception Value: 'Incident' instance needs to have a primary key value
before a many-to-many relationship can be used.


-- 
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: model refuses to save when manytomany field is blank

2011-04-04 Thread Kenneth Gonsalves
please ignore this - there was some validation that was messing with
things

On Mon, 2011-04-04 at 15:41 +0530, Kenneth Gonsalves wrote:
> hi,
> 
> i have a model like this:
> class Incident(models.Model):
> 
> escalate = models.IntegerField()
> escalatelist =
> models.ManyToManyField(Escalatelist,null=True,blank=True)
> 
> other fields removed for clarity. If I save this in admin, I get this
> error:
> 'Incident' instance needs to have a primary key value before a
> many-to-many relationship can be used.
> 
> the full traceback is:
> 
> Environment:
> 
> 
> Request Method: POST
> Request URL: http://127.0.0.1:8999/admin/incident/incident/add/
> 
> Django Version: 1.3 SVN-15966
> Python Version: 2.6.2
> Installed Applications:
> ['django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.sites',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'django.contrib.admin',
>  'employee',
>  'incident']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware')
> 
> 
> Traceback:
> File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py" in
> get_response
>   111. response = callback(request,
> *callback_args, **callback_kwargs)
> File "/usr/lib/python2.6/site-packages/django/contrib/admin/options.py"
> in wrapper
>   306. return self.admin_site.admin_view(view)(*args,
> **kwargs)
> File "/usr/lib/python2.6/site-packages/django/utils/decorators.py" in
> _wrapped_view
>   90. response = view_func(request, *args, **kwargs)
> File "/usr/lib/python2.6/site-packages/django/views/decorators/cache.py"
> in _wrapped_view_func
>   75. response = view_func(request, *args, **kwargs)
> File "/usr/lib/python2.6/site-packages/django/contrib/admin/sites.py" in
> inner
>   197. return view(request, *args, **kwargs)
> File "/usr/lib/python2.6/site-packages/django/utils/decorators.py" in
> _wrapper
>   25. return bound_func(*args, **kwargs)
> File "/usr/lib/python2.6/site-packages/django/utils/decorators.py" in
> _wrapped_view
>   90. response = view_func(request, *args, **kwargs)
> File "/usr/lib/python2.6/site-packages/django/utils/decorators.py" in
> bound_func
>   21. return func(self, *args2, **kwargs2)
> File "/usr/lib/python2.6/site-packages/django/db/transaction.py" in
> inner
>   211. return func(*args, **kwargs)
> File "/usr/lib/python2.6/site-packages/django/contrib/admin/options.py"
> in add_view
>   863. if form.is_valid():
> File "/usr/lib/python2.6/site-packages/django/forms/forms.py" in
> is_valid
>   121. return self.is_bound and not bool(self.errors)
> File "/usr/lib/python2.6/site-packages/django/forms/forms.py" in
> _get_errors
>   112. self.full_clean()
> File "/usr/lib/python2.6/site-packages/django/forms/forms.py" in
> full_clean
>   269. self._post_clean()
> File "/usr/lib/python2.6/site-packages/django/forms/models.py" in
> _post_clean
>   331. self.instance.clean()
> File "/home/lawgon/servicefirst/incident/models.py" in clean
>   182. if not self.escalatelist:
> File
> "/usr/lib/python2.6/site-packages/django/db/models/fields/related.py" in
> __get__
>   731. reverse=False
> File
> "/usr/lib/python2.6/site-packages/django/db/models/fields/related.py" in
> __init__
>   493. raise ValueError("%r instance needs to have a
> primary key value before a many-to-many relationship can be used." %
> instance.__class__.__name__)
> 
> Exception Type: ValueError at /admin/incident/incident/add/
> Exception Value: 'Incident' instance needs to have a primary key value
> before a many-to-many relationship can be used.
> 
> 
> -- 
> 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.
> 


-- 
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: admin cannot edit records with 'add' as primary key

2011-04-04 Thread Marwan Al-Sabbagh
Exactly, I think an assumption was made in the original design of the
URLs about the values of the primary keys, maybe that they would be
numeric. So this case brakes that assumption.

Marwan

On Mon, Apr 4, 2011 at 12:52 AM, Marc Aymerich  wrote:
>
>
> On Fri, Apr 1, 2011 at 8:39 PM, Marwan Al-Sabbagh
>  wrote:
>>
>> Hi,
>>   just wanted to confirm that this is a bug before posting it on
>> tracker. Any comments are welcome it will be my first bug report on
>> django :)
>>
>> Problem
>> 
>>  If you have a model with a primary key field that has the value
>> 'add' you won't be able to edit it in the admin screens. the admin
>> will take you to the add page instead of the change page for that
>> record. this is a problem with the design of the urls in the admin
>> module.
>>
>> admin.py
>> =
>> from polls.models import poll
>> from django.contrib import admin
>>
>> admin.site.register(poll)
>>
>> model.py
>> =
>> from django.db import models
>>
>> class poll(models.Model):
>>    id = models.CharField(max_length=200, primary_key=True)
>>    question = models.CharField(max_length=200)
>>
>> Reproducing
>> 
>>  1. Create project and app, enable admin, add the above files and syncdb.
>>  2. Go to the admin interface and select Add poll
>>  3. specify 'add' as the id and 'test' as question
>>  4. Save
>>  5. Go back to the list
>>  6. Open the same object
>>  7. you will be taken to the add poll screen instead of the change
>> poll screen for the selected object
>
>
> The problem here is the change view URL of an object with 'add' as a primary
> key is the same as add view URL :)
> --
> Marc
>
> --
> 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.



Authentication system

2011-04-04 Thread GOUTAM KUMAR RANA
How to port authentication system to every page so that only logged in
will able to view the pages or else it shall redirect to the login
page giving error that user should be logged in first.

for a custom project is the djangos admin used for login features or
we can have our own.
please help me if there is a different custom auth system

-- 
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: Authentication system

2011-04-04 Thread Tonton
i beleve it is

@login_required
before the method in views.py  to protect access by decorators

http://docs.djangoproject.com/en/1.3/releases/1.2/

On Mon, Apr 4, 2011 at 2:22 PM, GOUTAM KUMAR RANA wrote:

> How to port authentication system to every page so that only logged in
> will able to view the pages or else it shall redirect to the login
> page giving error that user should be logged in first.
>
> for a custom project is the djangos admin used for login features or
> we can have our own.
> please help me if there is a different custom auth system
>
> --
> 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: Authentication system

2011-04-04 Thread Shawn Milochik
Do the check in middleware instead of using the login_required
decorator everywhere.

There are snippets on DjangoSnippets for it. They vary slightly in
design, so check them out and pick the one that's best for your
situation.

Briefly, your middleware will check if request.user either
is_authenticated or is_anonymous, then issue a redirect for those not
logged in.

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.



Advice: project hosting apps

2011-04-04 Thread Peter Herndon
Hi all,

I'm tasked to build an internal project hosting site similar to Github
or Bitbucket for my employer, and I'm wondering what the current
state-of-the-art is for this. I want to provide per-project issue
tracking, wiki or other documentation building, and a nice view of
each project's git repository.

Please let me know of any recommendations you may have for apps that
supply this sort of functionality. I greatly appreciate any
suggestions you may have.

Thanks,

---Peter Herndon

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



Python Decorators

2011-04-04 Thread cootetom
Hi all, not exactly a django question but here goes... I'm trying to
implement a decorator with one positional argument and one keyword
argument. My wrapper function gets the positional argument just fine
but the keyword argument throws an error "NameError: name 'as_string'
is not defined."

Code is;

def widget(widget_switch, as_string=False):
def decorator(func):
def wrapper(*args, **kwargs):
# logic in here can access the value of 'widget_switch'
but 'as_string' is not defined?
return func(*args, **kwargs)
return wrapper
return decorator

So if I decorate a view function with "@widget('some_widget',
as_string=True)" then the wrapper function is unable to use
'as_string'. I thought this was how python closer worked?

Any ideas?

-- 
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: Advice: project hosting apps

2011-04-04 Thread Kristaps Kūlis
Hi,
  Redmine(Ruby on Rails) and Trac(Python) are two most popular alternatives.
  Redmine is far easier to setup for multiple projects.
  Both support Wiki / issue tracking and git :)

  Btw, Code.Djangoproject.com uses Trac.

On Mon, Apr 4, 2011 at 4:25 PM, Peter Herndon  wrote:
> Hi all,
>
> I'm tasked to build an internal project hosting site similar to Github
> or Bitbucket for my employer, and I'm wondering what the current
> state-of-the-art is for this. I want to provide per-project issue
> tracking, wiki or other documentation building, and a nice view of
> each project's git repository.
>
> Please let me know of any recommendations you may have for apps that
> supply this sort of functionality. I greatly appreciate any
> suggestions you may have.
>
> Thanks,
>
> ---Peter Herndon
>
> --
> 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: Odd problem with queryset

2011-04-04 Thread Dmitry Kharlamov
Try to instead limit the QuerySet:

try:
post = Post.objects.filter(thread = self.pk).order_by('created')[:
1].get()
except DoesNotExist:
post = NULL

return post # or do something else

http://docs.djangoproject.com/en/1.3/topics/db/queries/#limiting-querysets

On Apr 4, 1:35 am, Adam Tonks  wrote:
> At the suggestion of someone on IRC, I tried accessing the first result from
> within my template, using {{ thread.original_author.0 }} (where
> original_author is the name of the function with the return statement), and
> that works fine.
>
> It's a workaround, but not ideal, as I'll be using it in various places
> throughout the project, and if I need to change it, that'd mean going
> through each bit of code manually (defeating the point of me writing the
> function in the first place).
>
> Exactly the same problem applies when I access the posts using
> self.post_set.order_by('created)[0]

-- 
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: Odd problem with queryset

2011-04-04 Thread Dmitry Kharlamov
Sorry, meant None instead of NULL — crazy past week with lots of JS in
my life!

On Apr 4, 1:35 am, Adam Tonks  wrote:
> At the suggestion of someone on IRC, I tried accessing the first result from
> within my template, using {{ thread.original_author.0 }} (where
> original_author is the name of the function with the return statement), and
> that works fine.
>
> It's a workaround, but not ideal, as I'll be using it in various places
> throughout the project, and if I need to change it, that'd mean going
> through each bit of code manually (defeating the point of me writing the
> function in the first place).
>
> Exactly the same problem applies when I access the posts using
> self.post_set.order_by('created)[0]

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



multilingual django

2011-04-04 Thread jay K.
Hello,

Currently I have 2 folders, one for german and english language
translations, respectively

The translations are inside a django.po file for each language.

I want to add a new language

How can I do it?

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: Advice: project hosting apps

2011-04-04 Thread Javier Guerra Giraldez
On Mon, Apr 4, 2011 at 8:25 AM, Peter Herndon  wrote:
> I want to provide per-project issue
> tracking, wiki or other documentation building, and a nice view of
> each project's git repository.

i use Fossil (http://www.fossil-scm.org)
here's a nice blog about it: http://sheddingbikes.com/posts/1276624594.html

-- 
Javier

-- 
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: Authentication system

2011-04-04 Thread Tonton
> Briefly, your middleware will check if request.user either
> is_authenticated or is_anonymous, then issue a redirect for those not
> logged in.
>
> Shawn
>
>
i don't know
maybe test the login state in your urls.py  before evrything

tonton

-- 
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: Documentation Checked But Unclear: How to supress form.errors from views when needed?

2011-04-04 Thread Henry Versemann
Yes. First thanks for the response. I'm doing some experimenting with the forms 
and well as the requests and possibly reusing them as much as possible, and one 
thing I thought I'd try was to reuse values from a previous screen  which some 
of the same fields names and types, so that when the new screen comes up as 
much data as possible has already been formatted on the screen and therefore 
requires fewer user keystrokes.  The actual issue I seem to be having is when I 
display the new screen for the first time, but with the previously POSTed 
information it seems to want to display errors, which I can understand, because 
since it thinks it's not the first time in that it should display errors, when 
there is no data in one or more of the required fields on the screen. I think I 
have it figured out how to get around this unless there are some pitfalls, in 
doing this a little differently, which I'm unaware of. Thanks again.

-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Sam Walters
Sent: Monday, April 04, 2011 1:46 AM
To: django-users@googlegroups.com
Subject: Re: Documentation Checked But Unclear: How to supress form.errors from 
views when needed?

I dont understand so you render a view with a form once and you get
form errors on the initial view?

Or

Is there a POST/GET with formdata being submitted generating this
issue? *which would be by design as fas as i can tell you want form
verification to work

Note:
http://docs.djangoproject.com/en/1.3/topics/forms/

If you are binding data to a form for a view and rendering it im
pretty sure you will see form errors if you leave fields blank etc.

cheers

sam_w


On Thu, Mar 31, 2011 at 8:10 AM, hank23  wrote:
> I have an edit screen with more than a dozen fields on it of various
> types (text/CharField, select/CharField, date/DateField). When I
> refresh the screen sometimes I want to suppress all of the field
> required errors generated by empty fields prior to the refresh
> actually taking place. So far I have not found anything that works. I
> know in a view that I can check if there are errors for particular
> fields(like this  if form.errors.has_key('title') :
>        titleerrors = len(form.errors['title'] titleerrors =
> str(titleerrors))) and then display the counts on the screen, but I
> have not figured out how to suppress them yet once I know they exist.
> I do not believe that I can suppress them at the form level in
> forms.py, in an overridden clean() method, without suppressing them
> all of the time, which is not my intent. Thanks for the help.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

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


!DSPAM:4d996ba5317541655416946!

-- 
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: Authentication system

2011-04-04 Thread Bryan
http://docs.djangoproject.com/en/1.3/topics/auth/#limiting-access-to-logged-in-users

You can either put the @log_required decorator on each of the views
you want protected, or you can do it the raw way (see link), which may
offer more flexibility.

On Apr 4, 5:22 am, GOUTAM KUMAR RANA  wrote:
> How to port authentication system to every page so that only logged in
> will able to view the pages or else it shall redirect to the login
> page giving error that user should be logged in first.
>
> for a custom project is the djangos admin used for login features or
> we can have our own.
> please help me if there is a different custom auth system

-- 
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: Do you combine you Django decorators?

2011-04-04 Thread andy
Thanks man this is even better. I have though about doing something
like this in the past but I thought using signals was how django did
things like this. I've been using middleware and never even though
about what they really do or how they work -- that's bad.

On Apr 4, 2:20 am, Sam Walters  wrote:
> Hi Andy
>
> I dont combine them... however:
> I was using a couple of decorators for almost every view in one
> project. Ended up putting them in middleware.
> Are these decorators for every view? Maybe you should consider middleware too.
>
> cheers
>
> sam_w
>
>
>
>
>
>
>
> On Mon, Apr 4, 2011 at 3:26 AM, andy  wrote:
> > Do you use several Django decorators for your views or do you combine
> > the common ones into one or two custom decorators?
>
> > This is just something that I have been a bit curious about for a
> > while now as I tend to hate using more that one decorator per view. I
> > have often thought about combining them. Thought I have not done so as
> > yet. I hate looking at it but it seem more flexible nonetheless.
>
> > --
> > 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.



Need Help Understanding How To Use Built-In Authentication

2011-04-04 Thread hank23
I'm trying to understand the authentication built-in to django and
have some questions. Since the built-in authentication seems to
provide many if not all of the forms and views needed, then do I need
to code anything but calls to those views, from my own views, which
will pass the various bits of information needed by them? if this is
so then do I even need to worry about coding login.html, or the
base.html, which are referenced in the documentation, to be able to
use the built-in authentication? Thanks for the help.

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



Re: Odd problem with queryset

2011-04-04 Thread bruno desthuilliers
On 3 avr, 23:12, Adam Tonks  wrote:
> I have a function in a model to return the first post in a forum thread.  At
> the moment, it looks like this:
>
> return Post.objects.filter(thread = self.pk).order_by('created')
>
> When I run it in my test forum, the code returns two posts:
>
> [,  reply to the test post.>]
>
> I then add a [0] to the end of the statement, to just return the first item, 
> creating this return statement:
>
> return Post.objects.filter(thread = self.pk).order_by('created')[0]
>
> This, however, gives me "Caught IndexError while rendering: list index out of 
> range".
>
> The only thing I changed the entire time was adding the [0]. I tested on the 
> same forum, with the same data etc.

If you really did test on the very same data set, same forum, *same
thread* (IOW ; same value for "self.pk") etc, you would'nt get an
IndexError, so there's obviously something different.


> If I remove the filter part (making the statement below), it works fine, 
> returning the first post in the queryset.
>
> return Post.objects.order_by('created')[0]

This returns all posts, whatever thread they belongs to.

>
> I have no idea why adding the [0] to get the first result of the queryset is 
> causing it to return an empty queryset.

It's not "causing it to return an empty queryset", it's raising an
index error because your queryset is already empty.

> If anyone has any suggestions as to what I could do, it'd be much appreciated.

try:
Post.objects.filter(thread = self.pk).order_by('created')[0]
except IndexError:
   # just so you know your queryset is really empty
   # comment this out (or even better remove it) once you made sure
   # the error was in your test, not in Django
   if Post.objects.filter(thread = self.pk).count():
   raise AssertionError("Something has gone terribly wrong")

   # here you may want to either return None if an empty thread is ok
for your,
   # or raise some specific exception else
   return None

-- 
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: Odd problem with queryset

2011-04-04 Thread Adam Tonks
On Monday, April 4, 2011 4:34:10 PM UTC+1, bruno desthuilliers wrote:
>
> If you really did test on the very same data set, same forum, *same 
> thread* (IOW ; same value for "self.pk") etc, you would'nt get an 
> IndexError, so there's obviously something different. 
>

I was literally just adding the [0] and refreshing the page, doing nothing 
else differently. With the [0], it errors. Without the [0], I get a list 
with two items.  The reason I posted this in here was for the very reason 
that I was getting an IndexError on a set that almost certainly shouldn't be 
empty.

I also worked out that the set wasn't empty by accessing the first item from 
the template instead (i.e. adding '.0' to the end of the value in the 
template tag, instead of [0] to the end of the return function in the 
model).
 

> ...
>
> This returns all posts, whatever thread they belongs to. 
>

I know, I was trying to point out that the change in behaviour when I add 
the [0] is most likely due to the filter command.
 
 

> It's not "causing it to return an empty queryset", it's raising an 
> index error because your queryset is already empty. 
>

If you know of a better way I can test it, I'd appreciate it, it will come 
in useful if something like this happens again.

I've since gone another route to avoid having to use the function (this was 
bugging the hell out of me), but thanks for your help + suggestion.

Adam

>
>

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



.Net Developer Job Opening - Valencia, CA

2011-04-04 Thread Makro Tech
Hi

This is Vignesh with Makro Technologies, Inc.
We have been in business for over 10 years and we are one of the Fast 500
National IT staffing and Solution firms in USA. Our clients include
country’s top-notch IT, Healthcare, Pharmaceutical, Financial,
Telecom,Government and other industries.

Staying current with technology, finding great consultants and exceeding our
clients' expectations are our primary objectives.

Thanks for your time and attention to this e-mail.  Please let me know if
you have any candidates available, please find the Job description as
mentioned below.

*Title : .Net Developer
Location : Valencia, CA
Duration :6 Months*
*Responsibilities:*
• Work closely with business representatives and other team members to
understand business requirements that drive the analysis, design and
development of quality technical solutions that align with business and IT
strategies and comply with corporate and regulatory standards
• Direct and participate in the full software development lifecycle
• Make recommendations towards the development of new systems or reuse of
existing systems
• Work on medium to large, varied and complex projects that require skill in
multiple technical environments and knowledge in various business areas
• Work on multiple simultaneous projects as a project team member and/or as
a project lead
• Coach and/or mentor more junior technical staff
*
Required Skills*
• Bachelor degree in Computer Science or a related area
• 7+ years of programming/systems analysis experience
• Waterfall SDLC experience
• Ability to be a self-starter in a dynamic and fast paced environment
• Microsoft technologies, including .Net, C#, VB.Net, ASP.Net, XML, HTML,
JavaScript.
• Tools: Visual Studio .Net 2008, SQL Server 2000-2008, SVN
• Database technologies: Microsoft SQL, Oracle PL/SQL
• Reporting systems: Crystal Reports Server 2008
• Regulatory software validation experience a plus

Thanks
*Vignesh
*Sr Talent Acquisation
Tel: 973-481-0100  Ext: 3069
Fax: 973 883 1488
*E mail:* vignesh.renik...@makrohealth.com
*Linkedin: 
**http://www.linkedin.com/in/vignesh1*

For current openings please visit
http://jobs.makrotech.com/searchjobs.aspx

Candidate HelpDesk: 973-679-5005
*
Makro Technologies Inc.*
www.makrotech.com
Corporate Headquarters: New Jersey
One Washington Park, Suite 1502, Newark, NJ 07102
*Other Offices:* Pennsylvania, Illinois, California
** Makro is a 3-time INC 5000 company for 2007/2008/2009
** Makro is a 3-time FAST 50 firm in NJ for 2005/2006/2007 (by Deloitte)
** Makro is a 3-time FAST 500 firm in USA for 2005/2006/2007 (by
Deloitte)

-- 
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: .Net Developer Job Opening - Valencia, CA

2011-04-04 Thread Casey Greene

Can we ban/filter this entire recruiting firm?  We already got this once:
http://groups.google.com/group/django-users/browse_thread/thread/c6abb660bc3d3de

This user is obviously spamming lots of inappropriate lists:
http://groups.google.com/groups/profile?enc_user=ERmrRBcAAAC95_Iec3-8bE73ZJ_XryWvHqZiDvCVswhrZ6TQxKj0ww

Casey

On 04/04/2011 10:03 AM, Makro Tech wrote:

Hi

This is Vignesh with Makro Technologies, Inc.

We have been in business for over 10 years and we are one of the Fast
500 National IT staffing and Solution firms in USA. Our clients include
country’s top-notch IT, Healthcare, Pharmaceutical, Financial,
Telecom,Government and other industries.

Staying current with technology, finding great consultants and exceeding
our clients' expectations are our primary objectives.

Thanks for your time and attention to this e-mail.  Please let me know
if you have any candidates available, please find the Job description as
mentioned below.

*Title : .Net Developer
Location : Valencia, CA
Duration :6 Months*

*Responsibilities:*
• Work closely with business representatives and other team members to
understand business requirements that drive the analysis, design and
development of quality technical solutions that align with business and
IT strategies and comply with corporate and regulatory standards
• Direct and participate in the full software development lifecycle
• Make recommendations towards the development of new systems or reuse
of existing systems
• Work on medium to large, varied and complex projects that require
skill in multiple technical environments and knowledge in various
business areas
• Work on multiple simultaneous projects as a project team member and/or
as a project lead
• Coach and/or mentor more junior technical staff
*
Required Skills*
• Bachelor degree in Computer Science or a related area
• 7+ years of programming/systems analysis experience
• Waterfall SDLC experience
• Ability to be a self-starter in a dynamic and fast paced environment
• Microsoft technologies, including .Net, C#, VB.Net, ASP.Net, XML,
HTML, JavaScript.
• Tools: Visual Studio .Net 2008, SQL Server 2000-2008, SVN
• Database technologies: Microsoft SQL, Oracle PL/SQL
• Reporting systems: Crystal Reports Server 2008
• Regulatory software validation experience a plus
Thanks
*Vignesh
*Sr Talent Acquisation
Tel: 973-481-0100  Ext: 3069
Fax: 973 883 1488
*E mail:* vignesh.renik...@makrohealth.com

*Linkedin: **http://www.linkedin.com/in/vignesh1*

For current openings please visit
http://jobs.makrotech.com/searchjobs.aspx

Candidate HelpDesk: 973-679-5005
*
Makro Technologies Inc.*
www.makrotech.com 
Corporate Headquarters: New Jersey
One Washington Park, Suite 1502, Newark, NJ 07102
*Other Offices:* Pennsylvania, Illinois, California
** Makro is a 3-time INC 5000 company for 2007/2008/2009
** Makro is a 3-time FAST 50 firm in NJ for 2005/2006/2007 (by Deloitte)
** Makro is a 3-time FAST 500 firm in USA for 2005/2006/2007 (by Deloitte)

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



select_related() changes type of DecimalField?

2011-04-04 Thread Carsten Fuchs

Dear Django list,

using Django 1.3 with Python 2.6.5 on Ubuntu 10.04 and mod_wsgi, with 
Oracle database, I've just experienced a case where the use of 
select_related() changes the result type of a DecimalField in a related 
object from decimal.Decimal to float (which in turn breaks my application).



In detail, please consider the following models (unrelated fields 
omitted for clarity):



class Code(models.Model):
id= models.BigIntegerField(primary_key=True)
grenzwert = models.DecimalField(null=True, max_digits=5, 
decimal_places=2, blank=True)


class Erfasst(models.Model):
id   = models.AutoField(primary_key=True)
code = models.ForeignKey(Code, db_column='code')


And the following shell session:

lori@keep-surfing:~/Zeiterfassung$ python manage.py shell
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from Zeiterfassung.Lori.models import *

>>> z = Erfasst.objects.get(id=2726498)
>>> z.code.grenzwert
Decimal('10.00')
>>> type(z.code.grenzwert)

>>> z.code.grenzwert > Decimal(0)
True

>>> z = Erfasst.objects.select_related().get(id=2726498)
>>> z.code.grenzwert
10.0
>>> type(z.code.grenzwert)

>>> z.code.grenzwert > Decimal(0)
False


(The last line is the one that caused/causes the problems in my app...)

In the second part of the example with select_related(), I'd have 
expected that it returns type decimal.Decimal as in the first.


Is this a bug in Django?
If not, is there a better solution to the problem than using 
isinstance() in every place where I have to compare DecimalField values? 
(I'm still quite new to Python, and might be overlooking something 
obvious...)


Python 2.7 seems to handle Decimal-float comparisons differently/better 
than 2.6, and the above would probably silently work with Python 2.7, 
but I currently cannot upgrade to Python 2.7.


I'd be very grateful for your advice.

Best regards,
Carsten



--
   Cafu - the open-source Game and Graphics Engine
for multiplayer, cross-platform, real-time 3D Action
  Learn more at http://www.cafu.de



smime.p7s
Description: S/MIME Cryptographic Signature


Re: multilingual django

2011-04-04 Thread Andre Terra
You'll need to run something like

./manage.py makemessages -l pt_BR


This would be the command for generating Brazilian Portuguese language
files. -l is the same as --locale=pt_BR.

Please refer to the docs for some specifics. These two sections should be
the most relevant for you right now:
http://docs.djangoproject.com/en/dev/ref/django-admin/#makemessages
http://docs.djangoproject.com/en/dev/ref/django-admin/#common-options

You'll also find a bunch of examples there. Let us know if you have any
other questions.


Cheers,
André Terra (airstrike)

On Mon, Apr 4, 2011 at 11:16 AM, jay K.  wrote:

> Hello,
>
> Currently I have 2 folders, one for german and english language
> translations, respectively
>
> The translations are inside a django.po file for each language.
>
> I want to add a new language
>
> How can I do it?
>
> thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Johnny Cache on Django 1.3

2011-04-04 Thread Matteius
Please keep us updated when a new release is available, I've had this
on my list of things to try for a while.

On Apr 4, 3:24 am, Daniel Hilton  wrote:
> On 4 April 2011 08:16, Charlie Offenbacher
>
>
>
>
>
>  wrote:
> > Hi everyone!
>
> > I'm try to install johnny-cache on Django 1.3. I literally followed
> > the instructions here (http://packages.python.org/johnny-cache/#)
> > exactly, using the memcached version.
>
> > Evverything runs okay, but nothing gets cached at all when I telnet to
> > memcached. When I used cache-machine, that worked fine, so I know my
> > memcached installation works.
>
> > Any suggestions on how to debug this problem?
>
> > Thanks for your time!!
> > ~Charlie
>
> > --
> > 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.
>
> If you read the docs (http://packages.python.org/johnny-cache/) on
> pypi  there is a reference to the incompatibility and the cause of the
> problem.
>
> Cheers,
> Dan
>
> --
> Dan Hilton
> www.twitter.com/danhiltonwww.DanHilton.co.uk
> 

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



Form displays as textarea on local server, but text input on remote server

2011-04-04 Thread kelp
Hello,
I have a form set up in the following way:
from django.db import models
from django import forms

class ContactForm(forms.Form):
subject = forms.CharField(max_length=100)
message = forms.CharField(widget=forms.Textarea)
sender = forms.EmailField()
cc_myself = forms.BooleanField(required=False)

On my local machine, the "message" actually displays as a textarea,
but on my remote server, the "message" displays as a text input. I am
using Django version 1.2.3 on my local server and 1.2.5 on my remote
server. Yes, I am sure that this file is identical on both servers.

I am displaying the field with a simple: {{ form.message }}

Why does it display differently?

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.



[Template Filter] How to get rid of the extra 0 after the decimal point?

2011-04-04 Thread David.D
I hope to get this result:
34.000 --> 34
34.100 --> 34.1
34.120 -->  34.12
34.123 -->  34.123

But the output of floatformat filter is like this:
34.000|floatformat:"-3" --> 34
34.100|floatformat:"-3" --> 34.100
34.120|floatformat:"-3" --> 34.120
34.123|floatformat:"-3" --> 34.123

Thank you very much.

-- 
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: Advice: project hosting apps

2011-04-04 Thread spawgi
We use an internal implementation of Trac in our org. I think Trac has a
good potential if used properly.
However the Trac workflows are directed mostly towards development tasks and
not QA tasks.

Redmine also has good features from what I have read. But I have never used
it.

Here is a comparison of project hosting and tracking tools.
http://en.wikipedia.org/wiki/Comparison_of_project_management_software

Hope this helps.

On Mon, Apr 4, 2011 at 7:50 PM, Javier Guerra Giraldez
wrote:

> On Mon, Apr 4, 2011 at 8:25 AM, Peter Herndon  wrote:
> > I want to provide per-project issue
> > tracking, wiki or other documentation building, and a nice view of
> > each project's git repository.
>
> i use Fossil (http://www.fossil-scm.org)
> here's a nice blog about it:
> http://sheddingbikes.com/posts/1276624594.html
>
> --
> Javier
>
> --
> 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.
>
>


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

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



[django-ratings]Problem if my id key is not an integer.

2011-04-04 Thread David.D
My models all extend my custom model class which id is a CharField not
a PositiveIntegerField like the Django's default
django.db.models.Model .

So, when I try to add a vote, I got a ValueError:
invalid literal for int() with base 10: 'my-char-id'

Because the object_id field is defined like this in django-
ratings.models:

object_id   = models.PositiveIntegerField()

Any ideas how should I deal with this ?

Thanks in advance.

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



creating a URL from scratch

2011-04-04 Thread jay K.
Hello

I have a website with www.xyz.com/subpage

I want to change the name of the subpage

how do you do it?

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: Problem if my id key is not an integer.

2011-04-04 Thread andy
Did you add a primary_key=True to your char field?

On Apr 4, 11:46 am, "David.D"  wrote:
> My models all extend my custom model class which id is a CharField not
> a PositiveIntegerField like the Django's default
> django.db.models.Model .
>
> So, when I try to add a vote, I got a ValueError:
> invalid literal for int() with base 10: 'my-char-id'
>
> Because the object_id field is defined like this in django-
> ratings.models:
>
> object_id       = models.PositiveIntegerField()
>
> Any ideas how should I deal with this ?
>
> Thanks in advance.

-- 
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: Johnny Cache on Django 1.3

2011-04-04 Thread Charlie Offenbacher
I read the docs (and the issues in their bug tracker), but my
impression was that the main incompatibility with Django 1.3 is
transactions, which we're not using.

Thanks for the reply,
~Charlie

On Apr 4, 4:24 am, Daniel Hilton  wrote:
> On 4 April 2011 08:16, Charlie Offenbacher
>
>
>
>
>
>
>
>
>
>  wrote:
> > Hi everyone!
>
> > I'm try to install johnny-cache on Django 1.3. I literally followed
> > the instructions here (http://packages.python.org/johnny-cache/#)
> > exactly, using the memcached version.
>
> > Evverything runs okay, but nothing gets cached at all when I telnet to
> > memcached. When I used cache-machine, that worked fine, so I know my
> > memcached installation works.
>
> > Any suggestions on how to debug this problem?
>
> > Thanks for your time!!
> > ~Charlie
>
> > --
> > 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.
>
> If you read the docs (http://packages.python.org/johnny-cache/) on
> pypi  there is a reference to the incompatibility and the cause of the
> problem.
>
> Cheers,
> Dan
>
> --
> Dan Hilton
> www.twitter.com/danhiltonwww.DanHilton.co.uk
> 

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



using a models fields

2011-04-04 Thread jay K.
Hello,

I got a couple of fields from a model I want to use

so the models.py looks like this
*
class XZY():

   latitude = models.CharField()
   longitude = models.CharField(.)
   zoomlevel = models.CharField()*

I want to retrieve the data inside latitude, longitude and zoomlevel
to be able to create a static map for different locations, using google maps

How can I retrieve the fields data?

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: Johnny Cache on Django 1.3

2011-04-04 Thread Roy Smith
Weird choice of name for this project.  Should have been
"djohnny-cache" :-)



On Mon, 2011-04-04 at 13:13 -0700, Charlie Offenbacher wrote:
> I read the docs (and the issues in their bug tracker), but my
> impression was that the main incompatibility with Django 1.3 is
> transactions, which we're not using.
> 
> Thanks for the reply,
> ~Charlie
> 
> On Apr 4, 4:24 am, Daniel Hilton  wrote:
> > On 4 April 2011 08:16, Charlie Offenbacher
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >  wrote:
> > > Hi everyone!
> >
> > > I'm try to install johnny-cache on Django 1.3. I literally followed
> > > the instructions here (http://packages.python.org/johnny-cache/#)
> > > exactly, using the memcached version.
> >
> > > Evverything runs okay, but nothing gets cached at all when I telnet to
> > > memcached. When I used cache-machine, that worked fine, so I know my
> > > memcached installation works.
> >
> > > Any suggestions on how to debug this problem?
> >
> > > Thanks for your time!!
> > > ~Charlie
> >
> > > --
> > > 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.
> >
> > If you read the docs (http://packages.python.org/johnny-cache/) on
> > pypi  there is a reference to the incompatibility and the cause of the
> > problem.
> >
> > Cheers,
> > Dan
> >
> > --
> > Dan Hilton
> > www.twitter.com/danhiltonwww.DanHilton.co.uk
> > 
> 


-- 
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: select_related() changes type of DecimalField?

2011-04-04 Thread Ian
On Apr 4, 12:05 pm, Carsten Fuchs  wrote:
> Is this a bug in Django?
> If not, is there a better solution to the problem than using
> isinstance() in every place where I have to compare DecimalField values?
> (I'm still quite new to Python, and might be overlooking something
> obvious...)

Yes, this appears to be a bug.  If you would, please create a ticket
for it in the Django Trac so that we don't forget about it.

Thanks,
Ian

-- 
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: creating a URL from scratch

2011-04-04 Thread Sandro Dutra
You've to informe on your URLConf.

2011/4/4 jay K. :
>
> Hello
>
> I have a website with www.xyz.com/subpage
>
> I want to change the name of the subpage
>
> how do you do it?
>
> 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.



jQuery namespace woes - calling third-party scripts

2011-04-04 Thread Andre Terra
Hello.

I'm trying to run the supersleight jQuery plugin (
http://allinthehead.com/retro/338/supersleight-jquery-plugin) for fixing PNG
transparency in IE6 (this is a corporate intranet project, so I must support
it).

However, I'm having trouble calling the script because it's telling me
jQuery is undefined. Could somebody please paste me an example of how I
should setup my project's main script (and references to both that and the
third-party files) so that either jQuery or $ will work anywhere they're
used?



TLDR; I just to call this 'supersleight' plugin on document ready:

django.jQuery('body').supersleight();

I know, it's incredibly simple, but I can't get it to work.


I thank you in advance for the help.


Sincerely,
André Terra (airstrike)

-- 
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: Johnny Cache on Django 1.3

2011-04-04 Thread Charlie Offenbacher
Alright, this was my bad! It was a silly configuration error. Just in
case anyone else runs across this, I was using the pattern for local
settings files where you do...

try:
from local_settings import *
else:
pass

... doesn't work so well if you have a syntax error in local_settings,
and it's hard to notice! Live and learn.

Thanks everyone, vanilla Johnny-Cache is working for me on 1.3 now!

On Apr 4, 4:13 pm, Charlie Offenbacher 
wrote:
> I read the docs (and the issues in their bug tracker), but my
> impression was that the main incompatibility with Django 1.3 is
> transactions, which we're not using.
>
> Thanks for the reply,
> ~Charlie
>
> On Apr 4, 4:24 am, Daniel Hilton  wrote:
>
>
>
>
>
>
>
> > On 4 April 2011 08:16, Charlie Offenbacher
>
> >  wrote:
> > > Hi everyone!
>
> > > I'm try to install johnny-cache on Django 1.3. I literally followed
> > > the instructions here (http://packages.python.org/johnny-cache/#)
> > > exactly, using the memcached version.
>
> > > Evverything runs okay, but nothing gets cached at all when I telnet to
> > > memcached. When I used cache-machine, that worked fine, so I know my
> > > memcached installation works.
>
> > > Any suggestions on how to debug this problem?
>
> > > Thanks for your time!!
> > > ~Charlie
>
> > > --
> > > 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.
>
> > If you read the docs (http://packages.python.org/johnny-cache/) on
> > pypi  there is a reference to the incompatibility and the cause of the
> > problem.
>
> > Cheers,
> > Dan
>
> > --
> > Dan Hilton
> > www.twitter.com/danhiltonwww.DanHilton.co.uk
> > 

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



Static/media url in template

2011-04-04 Thread Jon J
Maybe I'm missing something...

I would say I'm relatively familiar with the Django framework by this
point. I'm mocking up a website, and I want to link static files into
the base template. Instead of having the url's directly in the
template, I'd like to call the STATIC_URL variable from within the
template, so for example I could have



instead of

http://www.domain.org/style.css"; />

Is this something that's possible or advisable? How is this problem
normally handled so I don't have to retype pretty much everything if I
move my site around? I haven't been able to find anything in the
documentation regarding 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: .Net Developer Job Opening - Valencia, CA

2011-04-04 Thread Russell Keith-Magee
On Mon, Apr 4, 2011 at 11:55 PM, Casey Greene  wrote:
> Can we ban/filter this entire recruiting firm?  We already got this once:
> http://groups.google.com/group/django-users/browse_thread/thread/c6abb660bc3d3de

Done. He has been banned.

Yours,
Russ Magee %-)

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



Re: using a models fields

2011-04-04 Thread bishwendu kundu
You can try saving the data as
latitude=models.DecimalField(max_digits=7,decimal_places=4).Same for the
longitude field.Here the max_digits takes into account both decimal and
non-decimal places.All the data can be given in string form as it will be
automatically converted to proper format as specified in your models for
storing in database. I guess you will be using some criteria to extract data
from the database...so,code can look like

list_of_XYZ()=XYZ.objects.filter(criteria)
for i in list_of_XYZ:
i.latitude,i.longitude ,i.zoomlevel

On Tue, Apr 5, 2011 at 1:45 AM, jay K.  wrote:

> Hello,
>
> I got a couple of fields from a model I want to use
>
> so the models.py looks like this
> *
> class XZY():
>
>latitude = models.CharField()
>longitude = models.CharField(.)
>zoomlevel = models.CharField()*
>
> I want to retrieve the data inside latitude, longitude and zoomlevel
> to be able to create a static map for different locations, using google
> maps
>
> How can I retrieve the fields data?
>
> thanks
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Static/media url in template

2011-04-04 Thread Sam Walters
Yes it already exists {{MEDIA_URL}}

Thats what the settings.py file does...

There is a bunch of stuff you can read about in the docs:

http://docs.djangoproject.com/en/1.3/howto/static-files/

Also for some of my own deployments there are a bunch of static file
servers so i just put these into settings:
{{MEDIA_URL_VIDEO}}
{{MEDIA_URL_IMAGES}}
etc...

Basically its as extensible as you want to make it.

cheers

sam_w


On Tue, Apr 5, 2011 at 8:44 AM, Jon J  wrote:
> Maybe I'm missing something...
>
> I would say I'm relatively familiar with the Django framework by this
> point. I'm mocking up a website, and I want to link static files into
> the base template. Instead of having the url's directly in the
> template, I'd like to call the STATIC_URL variable from within the
> template, so for example I could have
>
> 
>
> instead of
>
> http://www.domain.org/style.css"; />
>
> Is this something that's possible or advisable? How is this problem
> normally handled so I don't have to retype pretty much everything if I
> move my site around? I haven't been able to find anything in the
> documentation regarding 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.
>
>

-- 
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: Need Help Understanding How To Use Built-In Authentication

2011-04-04 Thread Kenneth Gonsalves
On Mon, 2011-04-04 at 08:33 -0700, hank23 wrote:
> I'm trying to understand the authentication built-in to django and
> have some questions. Since the built-in authentication seems to
> provide many if not all of the forms and views needed, then do I need
> to code anything but calls to those views, from my own views, which
> will pass the various bits of information needed by them? if this is
> so then do I even need to worry about coding login.html, or the
> base.html, which are referenced in the documentation, to be able to
> use the built-in authentication? Thanks for the help. 

all you need to do is copy all the templates to a directory called
'registration' under your templates directory and do whatever style
modifications you want. The views will work automatically.
-- 
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: .Net Developer Job Opening - Valencia, CA

2011-04-04 Thread Kenneth Gonsalves
On Mon, 2011-04-04 at 11:55 -0400, Casey Greene wrote:
> Can we ban/filter this entire recruiting firm?  We already got this
> once:
> http://groups.google.com/group/django-users/browse_thread/thread/c6abb660bc3d3de
>  

he has spammed every list in India - and has now gone international
-- 
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.



installer

2011-04-04 Thread ydjango
Is there a package or easy way to create an installer to auto install
apache, django, mysql based web app?

There could be some manual steps like installing mysql and providing
setup screens to enter connection data to mysql and mail server.
I would want to at minimum, when installer is run by user, auto
install all the many python packages, install django and build my app,
and delete py files automatically.

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



Using the same block in a django template to display different information depending on a variable

2011-04-04 Thread Ethan Yandow
Hey Mr. Django! I am trying to have different information display in
the same block depending on a variable "choice" which is simply an
int. The way I was planning on doing so was going to be something like
the bellow code:

{% extends "index.html"%} {%block head%}

Welcome to Piss && ink {{user}}

{%endblock head%}
{%block one%}
The temperature in {{city}} is {{temperature}}°

{%endblock one%} {%if choice1 == 2 %} {%block two%}
The temperature in {{city}} is {{temperature}}°

{%endblock two%} {% endif %} {%comment%}{%if choice1 == 2 %} {%block
two%}
The temperature in {{city}} is {{temperature}}°

{%endblock%} {% endif %}{%endcomment%} {%block two%} {%csrf_token%} {%
if new_event %}
{{new_event}}

{% endif %} {%endblock%}
Now, the problem I am having is that the template doesn't like that
there are two blocks of the same name in the template. For some reason
it doesn't seem to care about the {%if%} statement that is checking
where the {%block%} is supposed to go. I thought that the {%if%}
statement would only execute what was inside itself depending on its
parameters but it doesn't seem to be doing that. It displays
everything inside the {%if%} no matter what "choice1" is equal too :
( Does anyone have any idea how I might be able to fix this? 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: Using the same block in a django template to display different information depending on a variable

2011-04-04 Thread Calvin Spealman
Just put the condition inside the block.

On Mon, Apr 4, 2011 at 7:34 PM, Ethan Yandow  wrote:
> Hey Mr. Django! I am trying to have different information display in
> the same block depending on a variable "choice" which is simply an
> int. The way I was planning on doing so was going to be something like
> the bellow code:
>
> {% extends "index.html"%} {%block head%}
>
> Welcome to Piss && ink {{user}}
>
> {%endblock head%}
> {%block one%}
> The temperature in {{city}} is {{temperature}}°
>
> {%endblock one%} {%if choice1 == 2 %} {%block two%}
> The temperature in {{city}} is {{temperature}}°
>
> {%endblock two%} {% endif %} {%comment%}{%if choice1 == 2 %} {%block
> two%}
> The temperature in {{city}} is {{temperature}}°
>
> {%endblock%} {% endif %}{%endcomment%} {%block two%} {%csrf_token%} {%
> if new_event %}
> {{new_event}}
>
> {% endif %} {%endblock%}
> Now, the problem I am having is that the template doesn't like that
> there are two blocks of the same name in the template. For some reason
> it doesn't seem to care about the {%if%} statement that is checking
> where the {%block%} is supposed to go. I thought that the {%if%}
> statement would only execute what was inside itself depending on its
> parameters but it doesn't seem to be doing that. It displays
> everything inside the {%if%} no matter what "choice1" is equal too :
> ( Does anyone have any idea how I might be able to fix this? 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.
>
>



-- 
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy

-- 
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: Advice: project hosting apps

2011-04-04 Thread Sells, Fred
I've seen a lot of chatter about Eclipse mylyn which can be integrated
with trak.  Not used it however.

-Original Message-
From: django-users@googlegroups.com
[mailto:django-users@googlegroups.com] On Behalf Of Javier Guerra
Giraldez
Sent: Monday, April 04, 2011 10:21 AM
To: django-users@googlegroups.com
Subject: Re: Advice: project hosting apps

On Mon, Apr 4, 2011 at 8:25 AM, Peter Herndon 
wrote:
> I want to provide per-project issue
> tracking, wiki or other documentation building, and a nice view of
> each project's git repository.

i use Fossil (http://www.fossil-scm.org)
here's a nice blog about it:
http://sheddingbikes.com/posts/1276624594.html

-- 
Javier

-- 
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: Using the same block in a django template to display different information depending on a variable

2011-04-04 Thread Russell Keith-Magee
> On Mon, Apr 4, 2011 at 7:34 PM, Ethan Yandow  wrote:
>> Hey Mr. Django! I am trying to have different information display in
>> the same block depending on a variable "choice" which is simply an
>> int. The way I was planning on doing so was going to be something like
>> the bellow code:
>>
>> {% extends "index.html"%} {%block head%}
>>
>> Welcome to Piss && ink {{user}}
>>
>> {%endblock head%}
>> {%block one%}
>> The temperature in {{city}} is {{temperature}}°
>>
>> {%endblock one%} {%if choice1 == 2 %} {%block two%}
>> The temperature in {{city}} is {{temperature}}°
>>
>> {%endblock two%} {% endif %} {%comment%}{%if choice1 == 2 %} {%block
>> two%}
>> The temperature in {{city}} is {{temperature}}°
>>
>> {%endblock%} {% endif %}{%endcomment%} {%block two%} {%csrf_token%} {%
>> if new_event %}
>> {{new_event}}
>>
>> {% endif %} {%endblock%}
>> Now, the problem I am having is that the template doesn't like that
>> there are two blocks of the same name in the template. For some reason
>> it doesn't seem to care about the {%if%} statement that is checking
>> where the {%block%} is supposed to go. I thought that the {%if%}
>> statement would only execute what was inside itself depending on its
>> parameters but it doesn't seem to be doing that. It displays
>> everything inside the {%if%} no matter what "choice1" is equal too :
>> ( Does anyone have any idea how I might be able to fix this? Thanks

On Tue, Apr 5, 2011 at 11:00 AM, Calvin Spealman  wrote:
> Just put the condition inside the block.

By way of clarification -- there's a reason that you need to take this approach.

{% block %} tags are the one and only example of precedence rules in
Django's template language. Blocks are evaluated before every other
tag, because they involve the gross structure of the template itself.
You can't have a "conditional block", because the conditional tags
aren't evaluated until after the block is evaluated.

Yours
Russ Magee %-)

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



Re: Using the same block in a django template to display different information depending on a variable

2011-04-04 Thread Sam Walters
Hey

Block tags dont work like that.

{%if choice1 == 2 %}

{% include "sometemplate.html" %}

{%endif%}

instead of:

 {%if choice1 == 2 %} {%block two%}
> The temperature in {{city}} is {{temperature}}°
>
> {%endblock two%} {% endif %}


I hope that was what you were thinking...
http://docs.djangoproject.com/en/1.3/topics/forms/

There is an example in the form docs.


cheers

sam_w

On Tue, Apr 5, 2011 at 9:34 AM, Ethan Yandow  wrote:
> Hey Mr. Django! I am trying to have different information display in
> the same block depending on a variable "choice" which is simply an
> int. The way I was planning on doing so was going to be something like
> the bellow code:
>
> {% extends "index.html"%} {%block head%}
>
> Welcome to Piss && ink {{user}}
>
> {%endblock head%}
> {%block one%}
> The temperature in {{city}} is {{temperature}}°
>
> {%endblock one%} {%if choice1 == 2 %} {%block two%}
> The temperature in {{city}} is {{temperature}}°
>
> {%endblock two%} {% endif %} {%comment%}{%if choice1 == 2 %} {%block
> two%}
> The temperature in {{city}} is {{temperature}}°
>
> {%endblock%} {% endif %}{%endcomment%} {%block two%} {%csrf_token%} {%
> if new_event %}
> {{new_event}}
>
> {% endif %} {%endblock%}
> Now, the problem I am having is that the template doesn't like that
> there are two blocks of the same name in the template. For some reason
> it doesn't seem to care about the {%if%} statement that is checking
> where the {%block%} is supposed to go. I thought that the {%if%}
> statement would only execute what was inside itself depending on its
> parameters but it doesn't seem to be doing that. It displays
> everything inside the {%if%} no matter what "choice1" is equal too :
> ( Does anyone have any idea how I might be able to fix this? Thanks
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: installer

2011-04-04 Thread Mike Dewhirst

On 5/04/2011 12:04pm, ydjango wrote:

Is there a package or easy way to create an installer to auto install
apache, django, mysql based web app?


The best way is to script the installation. Google for "scripted 
installs " or similar. You should find some examples you can 
rework to suit your needs.


I think this is a very healthy way to install stuff just in case you 
need to repeat the process on another machine. The scripts leave a nice 
record of what you have installed.



There could be some manual steps like installing mysql and providing
setup screens to enter connection data to mysql and mail server.
I would want to at minimum, when installer is run by user, auto
install all the many python packages, install django and build my app,
and delete py files automatically.

For Python applications you can also script installation. I usually call 
the Python script at the end of the os instyallation script. I use pip 
and here is an example. I uncomment lines as required and comment them 
out again after a successful install so I don't accidentally re-install. 
You need to study the documentation for pip if you decide to use it ...


#
# requires 1. setuptools and 2. pip
#
#pip install django
#pip install markdown
#pip install psycopg2
#pip install south
#pip install django-tagging
#pip install django-cms
# having trouble with buildbot/twisted - debug via /usr/local/lib64
#pip install buildbot
#pip install akismet

Mike

--
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: jQuery namespace woes - calling third-party scripts

2011-04-04 Thread mcniac
Hi!

   are you calling that script from the window's onload event? if not
jquery might not be ready yet. also you should load that inside a IE
conditional comment

Cheers
Esteban

On Apr 4, 6:21 pm, Andre Terra  wrote:
> Hello.
>
> I'm trying to run the supersleight jQuery plugin 
> (http://allinthehead.com/retro/338/supersleight-jquery-plugin) for fixing PNG
> transparency in IE6 (this is a corporate intranet project, so I must support
> it).
>
> However, I'm having trouble calling the script because it's telling me
> jQuery is undefined. Could somebody please paste me an example of how I
> should setup my project's main script (and references to both that and the
> third-party files) so that either jQuery or $ will work anywhere they're
> used?
>
> TLDR; I just to call this 'supersleight' plugin on document ready:
>
> django.jQuery('body').supersleight();
>
> I know, it's incredibly simple, but I can't get it to work.
>
> I thank you in advance for the help.
>
> Sincerely,
> André Terra (airstrike)

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



i18n and l10n of third party applications/libraries

2011-04-04 Thread poswald
I've got a situation similar to this one:

http://stackoverflow.com/questions/3933824/djangos-i18n-with-third-party-apps

Basically, I have a pip-installed third party library with strings
marked for localization but with no localizations provided. In my
project I would like to provide translations to be used for the
strings in this library. Is there a way to get 'manage.py
makemessages' to scan a third party library and create a po file for
it? Once that is done, where would the .mo file go such that it is
applied to the library objects when they call ugettext_lazy?

Thanks,
-Paul

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



Re: Advice: project hosting apps

2011-04-04 Thread Alex Kamedov
Eclipse mylyn can be integrated with Redmine too.
We are using Redmine with some plugins for time sheduling, SCRUM support
and generating charts about 2 years. It's very nice, but not all good
plugins is stable.

On Tue, Apr 5, 2011 at 9:03 AM, Sells, Fred wrote:

> Eclipse mylyn




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



Extending django-admin.py startproject/manage.py startapp: a good layout for reusable apps

2011-04-04 Thread MrMuffin
I`m writing a simple extension of django-admin.py/manage.py so I can
have a predefined set of configurations and use those when I create a
new project or reusable app. For instance, I use sqlite3 in the
initial stage of development so that should be set automatically. My
name doesn`t change that often, same for me email. Those things should
go into the settings.py by default. And when I create reusable apps I
don`t want to bother with setting hardcoded links in settings.py to my
template-folder in settings.py either.

So what I`m thinking of is an extension of manage.py, let`s call it
"lime" for now, an executable script, working something like this:

1. All my default values; name, email, django settings that doesn`t
change much are stored in a config file in my home directory like
~/.lime/config.ini
2. When I call "lime app blog" the result is:

* a folder with a package called blog, a complete reusable django app
( I use the standard django code to generate the app itself )
* a setup.py with my name, email, package info, basics requirements -
all ready for pypi uploading and distribution
* a test-project to test my reusable app, configured to use that app
and find the templates and static content automatically without adding
hardcoded paths to the settings.py of the test-project and an admin
inteface enabled by default
* a virtualenv for my test-project
* code revision files for files to ignore etc
* 

The goal is to quickly create a standardized, complete and distribute-
friendly layout for a reusable app and to cut down on the manual,
repetetive typing. I`m also planning to support different configs so
calling something like "lime app blog --config postgresql" will use a
config specifying the app to use a config called postgresql instead of
the default.

So what are your thoughts? And what is a good layout for a reusable
app? What else could be automated in django development?

My main motivation for this project came when I started working on a
plugin for the Editra editor for django management. I wanted to create
django reusable apps from inside the editor and I saw that a lot of
the initial work on a new app is very repetetive - first create
project, then create app, then edit settings.py, then urls.py to
enable admin, then edit views.py to enable admin etc. I want to have a
configurable standard layout for my apps created in very few steps,
from within Editra and outside the editor as well.

Thanks for your attention and hope to hear some of your ideas or
thoughts.

Regards,
Thomas

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