Re: TemplateSyntaxError at /admin/ Caught AttributeError while rendering: 'NoneType' object has no attribute 'id'

2011-12-20 Thread Branton Davis
It sure seems like #2 that I mentioned before is the issue.  Your context
processor is overriding the 'user' template context variable that the admin
uses.  I just looked at some admin templates and they definitely use the
'user' variable.  Name it something else or add logic to the context
processor to only add to the template context outside of the admin,
assuming all of your custom templates are outside of the admin.

On Tue, Dec 20, 2011 at 11:11 PM, Divkis  wrote:

>
> On Dec 21, 7:05 am, Karen Tracey  wrote:
> > People would be able to help you more effectively if you included the
> stack
> > trace that goes with the exception.
> >
> > Karen
> > --http://tracey.org/kmt/
>
> The stack trace for the error is:
>
> ERROR Caught AttributeError while rendering: 'User' object has no
> attribute 'id'
> Traceback (most recent call last):
>  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> base.py", line 111, in get_response
>response = callback(request, *callback_args, **callback_kwargs)
>  File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
> sites.py", line 214, in wrapper
>return self.admin_view(view, cacheable)(*args, **kwargs)
>  File "/usr/local/lib/python2.6/dist-packages/django/utils/
> decorators.py", line 93, in _wrapped_view
>response = view_func(request, *args, **kwargs)
>  File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/
> cache.py", line 79, in _wrapped_view_func
>response = view_func(request, *args, **kwargs)
>  File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
> sites.py", line 197, in inner
>return view(request, *args, **kwargs)
>  File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/
> cache.py", line 79, in _wrapped_view_func
>response = view_func(request, *args, **kwargs)
>  File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
> sites.py", line 382, in index
>context_instance=context_instance
>  File "/usr/local/lib/python2.6/dist-packages/django/shortcuts/
> __init__.py", line 20, in render_to_response
>return HttpResponse(loader.render_to_string(*args, **kwargs),
> **httpresponse_kwargs)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> loader.py", line 188, in render_to_string
>return t.render(context_instance)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> base.py", line 123, in render
>return self._render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
> line 57, in instrumented_test_render
>return self.nodelist.render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> base.py", line 744, in render
>bits.append(self.render_node(node, context))
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> debug.py", line 73, in render_node
>result = node.render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> loader_tags.py", line 127, in render
>return compiled_parent._render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
> line 57, in instrumented_test_render
>return self.nodelist.render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> base.py", line 744, in render
>bits.append(self.render_node(node, context))
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> debug.py", line 73, in render_node
>result = node.render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> loader_tags.py", line 127, in render
>return compiled_parent._render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
> line 57, in instrumented_test_render
>return self.nodelist.render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> base.py", line 744, in render
>bits.append(self.render_node(node, context))
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> debug.py", line 73, in render_node
>result = node.render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> loader_tags.py", line 64, in render
>result = block.nodelist.render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> base.py", line 744, in render
>bits.append(self.render_node(node, context))
>  File "/usr/local/lib/python2.6/dist-packages/django/template/
> debug.py", line 73, in render_node
>result = node.render(context)
>   File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
> templatetags/log.py", line 19, in render
>user_id = context[self.user].id
> TemplateSyntaxError: Caught AttributeError while rendering: 'User'
> object has no attribute 'id'
> [21/Dec/2011 10:40:00] "GET /admin/ HTTP/1.1" 500 493324
>
>
> Thanks for helping,
> Regards,
> DivKis
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to dja

Jython zxJDBC / Python cx_oracle wrong number or types of arguments when calling to oracle's stored procedure

2011-12-20 Thread Akira Kir
 

Trying to make a django test application which will use stored oracle's 
procedures to insert/get data.

Using jython with zxJDBC but same error applies with python and cx_oracle 
too.

here is some code snipets:

models.py

> from django.db import models
> from django.db import connection
>
> class ALEX_TEST_PKG():
> def get_data(self, inparam1):
> cursor = connection.cursor()
> ret = cursor.callproc("ALEX_TEST_PKG.test0", inparam1)
> cursor.close
> return ret
>
> views.py

> class TestForm(forms.Form):
> inparam1 = forms.IntegerField()
>
>
> def message(request):
> if request.method == 'POST':
> form = TestForm(request.POST)
> else:
> form = TestForm()
> if form.is_valid():
> my_util = ALEX_TEST_PKG()
> ret = my_util.get_data(request.POST['inparam1'])
> return HttpResponse(ret)
> return render_to_response('form.html', {'form':form}, 
> context_instance=RequestContext(request))
>
>
oracle's procedures:

> CREATE OR REPLACE PACKAGE BODY ALEX.alex_test_pkg
> IS
>PROCEDURE test0 (inparam1 IN integer)
>IS
>BEGIN
>   insert into alex_debug(col1) values(inparam1); 
>END test0;
> END alex_test_pkg;
> /
>
>
Django error log:

> Environment:
>
>
> Request Method: POST
> Request URL: http://localhost:8000/form/
>
> Django Version: 1.3.1
> Python Version: 2.7.0
> Installed Applications:
> ['django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.sites',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'django.contrib.admin',
>  'dbtest']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware')
>
>
> Traceback:
> File 
> "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\core\handlers\base.py"
>  in get_response
>   111. response = callback(request, *callback_args, 
> **callback_kwargs)
> File "E:\WatchTower\workspace3\erwtwe\erwtwe\dbtest\views.py" in message
>   19. ret = my_util.get_data(request.POST['inparam1'])
> }File "E:\WatchTower\workspace3\erwtwe\erwtwe\dbtest\models.py" in get_data
>   7. ret = cursor.callproc("ALEX_TEST_PKG.test0", inparam1)
>
> Exception Type: DatabaseError at /form/
> Exception Value: ORA-06550: line 1, column 7:
> PLS-00306: wrong number or types of arguments in call to 'TEST0'
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignore
>
>
 

Any help is appriciated. breaking my head with this for 4 days already.

{stackoverflow xposted}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/mc_0lbAI4yEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: TemplateSyntaxError at /admin/ Caught AttributeError while rendering: 'NoneType' object has no attribute 'id'

2011-12-20 Thread Branton Davis
On Tue, Dec 20, 2011 at 11:09 PM, Divick Kishore
wrote:

> On Wed, Dec 21, 2011 at 6:04 AM, Branton Davis 
> wrote:
> > It sounds like your custom user template context variable might be
> causing a
> > conflict with the default if you're also using django.contrib.auth
> (which is
> > what the admin uses by default).  I'm guessing that the admin
> > views/templates use a 'user' variable.
>
> Yeah, I am using the django.contrib.auth in my project.
>
> >
> > Not knowing anything your project, I assume your User model is an
> extension
> > of the django User model.  If so, I would generally recommend extending
> the
> > django User model, as described yonder:
> >
> https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
> >
>
> I don't really need /want my User model to be an extension of django's
> User model. I need admin functionality only for backend processing and
> the users don't login to my site using the regular admin User. I just
> want person handling the backend to modify and edit the Database
> visually (mostly for order processing).
>
> > At the very least, for debugging your current problem, a couple things to
> > try:
> >   1) Pull your custom context processor out of the loop and see if the
> admin
> > works correctly.  If so, that confirms that it caused a conflict.
> >   - If you have custom admin templates (for the /admin/ view, or
> > whatever view you're trying to hit), you may also have to adjust them, if
> > they were relying on that context variable.
> >   2) Change the name of the context variable you use (try 'appname_user'
> or
> > something else that will differentiate it.
>
> I tried both but I am getting a completely different error (stack trace
> below).
>
>
> ERROR Caught ViewDoesNotExist while rendering: Tried
> ajax_handle_wishinvite in module gifts.views. Error was: 'module'
> object has no attribute 'ajax_handle_wishinvite'
> Traceback (most recent call last):
>  File
> "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py",
> line 111, in get_response
>response = callback(request, *callback_args, **callback_kwargs)
>  File
> "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py",
> line 214, in wrapper
>return self.admin_view(view, cacheable)(*args, **kwargs)
>  File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py",
> line 93, in _wrapped_view
>response = view_func(request, *args, **kwargs)
>  File
> "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py",
> line 79, in _wrapped_view_func
>response = view_func(request, *args, **kwargs)
>  File
> "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py",
> line 197, in inner
>return view(request, *args, **kwargs)
>  File
> "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py",
> line 79, in _wrapped_view_func
>response = view_func(request, *args, **kwargs)
>  File
> "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py",
> line 382, in index
>context_instance=context_instance
>  File
> "/usr/local/lib/python2.6/dist-packages/django/shortcuts/__init__.py",
> line 20, in render_to_response
>return HttpResponse(loader.render_to_string(*args, **kwargs),
> **httpresponse_kwargs)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py",
> line 188, in render_to_string
>return t.render(context_instance)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/base.py",
> line 123, in render
>return self._render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
> line 57, in instrumented_test_render
>return self.nodelist.render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/base.py",
> line 744, in render
>bits.append(self.render_node(node, context))
>  File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py",
> line 73, in render_node
>result = node.render(context)
>  File
> "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py",
> line 127, in render
>return compiled_parent._render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
> line 57, in instrumented_test_render
>return self.nodelist.render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/base.py",
> line 744, in render
>bits.append(self.render_node(node, context))
>  File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py",
> line 73, in render_node
>result = node.render(context)
>  File
> "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py",
> line 127, in render
>return compiled_parent._render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
> line 57, in instrumented_test_render
>return self.nodelist.render(context)
>  File "/usr/local/lib/python2.6/dist-packages/django/template/base.py",
> line 744, in render
>

Re: TemplateSyntaxError at /admin/ Caught AttributeError while rendering: 'NoneType' object has no attribute 'id'

2011-12-20 Thread Divick Kishore
Hi Branton,

On Wed, Dec 21, 2011 at 11:09 AM, Branton Davis  wrote:
>
> That stack trace is unrelated to the other problem.  Somewhere (guessing
> gifts/urls.py) you've referenced a view
> at gifts.views.ajax_handle_wishinvite, which doesn't exist.  Check
> gifts/views.py for a method named 'ajax_handle_wishinvite', which is likely
> missing or misspelled.

Yeah fixing this resolved the whole problem once I also renamed the
variable in my own context processor from 'user' to 'myuser'.

Thanks a lot for your help,
Regards,
DivKis

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: TemplateSyntaxError at /admin/ Caught AttributeError while rendering: 'NoneType' object has no attribute 'id'

2011-12-20 Thread Divkis

On Dec 21, 7:05 am, Karen Tracey  wrote:
> People would be able to help you more effectively if you included the stack
> trace that goes with the exception.
>
> Karen
> --http://tracey.org/kmt/

The stack trace for the error is:

ERROR Caught AttributeError while rendering: 'User' object has no
attribute 'id'
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
sites.py", line 214, in wrapper
return self.admin_view(view, cacheable)(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/
decorators.py", line 93, in _wrapped_view
response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/
cache.py", line 79, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
sites.py", line 197, in inner
return view(request, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/
cache.py", line 79, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
sites.py", line 382, in index
context_instance=context_instance
  File "/usr/local/lib/python2.6/dist-packages/django/shortcuts/
__init__.py", line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs),
**httpresponse_kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/template/
loader.py", line 188, in render_to_string
return t.render(context_instance)
  File "/usr/local/lib/python2.6/dist-packages/django/template/
base.py", line 123, in render
return self._render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
line 57, in instrumented_test_render
return self.nodelist.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/
base.py", line 744, in render
bits.append(self.render_node(node, context))
  File "/usr/local/lib/python2.6/dist-packages/django/template/
debug.py", line 73, in render_node
result = node.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/
loader_tags.py", line 127, in render
return compiled_parent._render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
line 57, in instrumented_test_render
return self.nodelist.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/
base.py", line 744, in render
bits.append(self.render_node(node, context))
  File "/usr/local/lib/python2.6/dist-packages/django/template/
debug.py", line 73, in render_node
result = node.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/
loader_tags.py", line 127, in render
return compiled_parent._render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
line 57, in instrumented_test_render
return self.nodelist.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/
base.py", line 744, in render
bits.append(self.render_node(node, context))
  File "/usr/local/lib/python2.6/dist-packages/django/template/
debug.py", line 73, in render_node
result = node.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/
loader_tags.py", line 64, in render
result = block.nodelist.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/
base.py", line 744, in render
bits.append(self.render_node(node, context))
  File "/usr/local/lib/python2.6/dist-packages/django/template/
debug.py", line 73, in render_node
result = node.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
templatetags/log.py", line 19, in render
user_id = context[self.user].id
TemplateSyntaxError: Caught AttributeError while rendering: 'User'
object has no attribute 'id'
[21/Dec/2011 10:40:00] "GET /admin/ HTTP/1.1" 500 493324


Thanks for helping,
Regards,
DivKis

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: TemplateSyntaxError at /admin/ Caught AttributeError while rendering: 'NoneType' object has no attribute 'id'

2011-12-20 Thread Divick Kishore
On Wed, Dec 21, 2011 at 6:04 AM, Branton Davis  wrote:
> It sounds like your custom user template context variable might be causing a
> conflict with the default if you're also using django.contrib.auth (which is
> what the admin uses by default).  I'm guessing that the admin
> views/templates use a 'user' variable.

Yeah, I am using the django.contrib.auth in my project.

>
> Not knowing anything your project, I assume your User model is an extension
> of the django User model.  If so, I would generally recommend extending the
> django User model, as described yonder:
> https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
>

I don't really need /want my User model to be an extension of django's
User model. I need admin functionality only for backend processing and
the users don't login to my site using the regular admin User. I just
want person handling the backend to modify and edit the Database
visually (mostly for order processing).

> At the very least, for debugging your current problem, a couple things to
> try:
>   1) Pull your custom context processor out of the loop and see if the admin
> works correctly.  If so, that confirms that it caused a conflict.
>   - If you have custom admin templates (for the /admin/ view, or
> whatever view you're trying to hit), you may also have to adjust them, if
> they were relying on that context variable.
>   2) Change the name of the context variable you use (try 'appname_user' or
> something else that will differentiate it.

I tried both but I am getting a completely different error (stack trace below).


ERROR Caught ViewDoesNotExist while rendering: Tried
ajax_handle_wishinvite in module gifts.views. Error was: 'module'
object has no attribute 'ajax_handle_wishinvite'
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py",
line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py",
line 214, in wrapper
return self.admin_view(view, cacheable)(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py",
line 93, in _wrapped_view
response = view_func(request, *args, **kwargs)
  File 
"/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py",
line 79, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py",
line 197, in inner
return view(request, *args, **kwargs)
  File 
"/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py",
line 79, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py",
line 382, in index
context_instance=context_instance
  File "/usr/local/lib/python2.6/dist-packages/django/shortcuts/__init__.py",
line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs),
**httpresponse_kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py",
line 188, in render_to_string
return t.render(context_instance)
  File "/usr/local/lib/python2.6/dist-packages/django/template/base.py",
line 123, in render
return self._render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
line 57, in instrumented_test_render
return self.nodelist.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/base.py",
line 744, in render
bits.append(self.render_node(node, context))
  File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py",
line 73, in render_node
result = node.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py",
line 127, in render
return compiled_parent._render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
line 57, in instrumented_test_render
return self.nodelist.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/base.py",
line 744, in render
bits.append(self.render_node(node, context))
  File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py",
line 73, in render_node
result = node.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py",
line 127, in render
return compiled_parent._render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/test/utils.py",
line 57, in instrumented_test_render
return self.nodelist.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/template/base.py",
line 744, in render
bits.append(self.render_node(node, context))
  File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py",
line 73, in render_node
result = node.render(context)
  File "/usr/local/lib/python2.6/dist-packages/django/templat

Re: new tables missing from admin page

2011-12-20 Thread Python_Junkie
You should confirm that the tables that you added to the database, do
in fact exist, by querying the database, before wondering why they did
not show up in the admin page

On Dec 20, 9:08 pm, Karen Tracey  wrote:
> No, it doesn't happen automatically. (Unless prior to this change you were
> using plug-in apps that all provided an admin.py file to register their
> models.) For any models in apps you write, you must explicitly register
> them with admin in order for them to be visible in admin.
>
> Karen
> --http://tracey.org/kmt/

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



Re: new tables missing from admin page

2011-12-20 Thread Karen Tracey
No, it doesn't happen automatically. (Unless prior to this change you were
using plug-in apps that all provided an admin.py file to register their
models.) For any models in apps you write, you must explicitly register
them with admin in order for them to be visible in admin.

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: TemplateSyntaxError at /admin/ Caught AttributeError while rendering: 'NoneType' object has no attribute 'id'

2011-12-20 Thread Karen Tracey
People would be able to help you more effectively if you included the stack
trace that goes with the exception.

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: ModelForms and ProcessFormViews w models containing BooleanFields

2011-12-20 Thread Karen Tracey
Specify blank=True on the model field. When a ModelForm is created, the
default value for a model form field's "required" attribute is based on the
corresponding model field's "blank" attribute.

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Treebeard admin issues: Fieldsets break code...

2011-12-20 Thread Micky Hulse
On Tue, Dec 20, 2011 at 5:42 PM, Micky Hulse  wrote:
> Traceback:
> 

Sorry, moved here:



Let me know if I can provide more trace info.

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.



Treebeard admin issues: Fieldsets break code...

2011-12-20 Thread Micky Hulse
Hello,

I am building a simple flat pages app and I am running into problems
using Treebeard.

For those not familiar with Treebeard:



Treebeard example app:



Ok, here's my code:



Traceback:



Everything works great when I remove the "filedsets" from the admin.

I don't understand why having fieldsets would break things...
Everything was working before adding Treebeard.

Just wondering if this is a Treebeard bug, or am I missing something
obvious here?

Note: Unfortunately, I have not found any Treebeard examples that use
fieldsets in the admin. :(

Any tips/help/advice would be spectacular! :)

Thanks!
Micky

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Anyone got time for a large scale project ?

2011-12-20 Thread Robert Steckroth
Is this a paying project? I have a wide range of skills including Django.

On Tue, Dec 20, 2011 at 3:17 PM, JohnyB  wrote:
> Hello guys,
> I am in the process of creating an informational website combined with
> a desktop application, and mobile version all connected, but I am
> overwhelmed by it, and would need some help on django part.
> If you are intereseted please contact me.
>
> Thank you for your time,
> Ionut Boboc
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Bringing game to younix
Bust0ut Entertainment  ---
PBDefence.com
"Finding the exit without looking"

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



Anyone got time for a large scale project ?

2011-12-20 Thread JohnyB
Hello guys,
I am in the process of creating an informational website combined with
a desktop application, and mobile version all connected, but I am
overwhelmed by it, and would need some help on django part.
If you are intereseted please contact me.

Thank you for your time,
Ionut Boboc

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



Re: new tables missing from admin page

2011-12-20 Thread Bill Beal
Thanks.  I don't remember doing this when I created the first set of
tables.  Does it happen automatically once?  Or maybe I was mindlessly
working from an example in a book.  I'm a sorcerer's apprentice without a
sorcerer.  (There's a spell-checker pun in there somewhere.)

Bill


On Tue, Dec 20, 2011 at 1:24 PM, Anoop Thomas Mathew wrote:

> Hi,
> You should register the new models in the admin.py.
> https://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-objects
> Above link should help.
>
> Thanks,
> Anoop Thomas Mathew
> atm
> ___
> Life is short, Live it hard.
>
>
>
>
> On 20 December 2011 23:32, Bill Beal  wrote:
>
>> Hi all,
>>
>> I added some tables to models.py but they didn't show up
>> when I logged in as admin.  I knew already from harsh
>> experience that syncdb will not pick up _changes_ to an
>> existing table, so I deleted the old database before doing
>> syncdb then runserver.  When I didn't find the new tables
>> listed on the admin page, I shut down the server, blew
>> away all .pyc files in the project and app directories, then
>> ran runserver again.  Tables were still missing from admin.
>> sqlall showed the new tables.  dbshell with .tables
>> command showed the new tables.  I'm using Python 2.6.6,
>> Django 1.3, SQLite 3.7.2.  What's the missing link? How
>> can there be any file left that only has the old tables?
>>
>> Bill Beal
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



TemplateSyntaxError at /admin/ Caught AttributeError while rendering: 'NoneType' object has no attribute 'id'

2011-12-20 Thread Divkis
I get the following error when I try to access admin site. I am not
sure what is causing this. I am not sure if it could be caused because
one of the two reasons:

1. I have a User model in one of my apps which does not have a id as
primary key. I have some other key as the primary key.

2. I have a custom context processor in which I set an instance of my
own app's User model with key 'user'.

Could someone please suggest what is the cause of this error and I
could I go about fixing it?

Thanks in advance,
DivKis

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



Re: new tables missing from admin page

2011-12-20 Thread Anoop Thomas Mathew
Hi,
You should register the new models in the admin.py.
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-objects
Above link should help.

Thanks,
Anoop Thomas Mathew
atm
___
Life is short, Live it hard.




On 20 December 2011 23:32, Bill Beal  wrote:

> Hi all,
>
> I added some tables to models.py but they didn't show up
> when I logged in as admin.  I knew already from harsh
> experience that syncdb will not pick up _changes_ to an
> existing table, so I deleted the old database before doing
> syncdb then runserver.  When I didn't find the new tables
> listed on the admin page, I shut down the server, blew
> away all .pyc files in the project and app directories, then
> ran runserver again.  Tables were still missing from admin.
> sqlall showed the new tables.  dbshell with .tables
> command showed the new tables.  I'm using Python 2.6.6,
> Django 1.3, SQLite 3.7.2.  What's the missing link? How
> can there be any file left that only has the old tables?
>
> Bill Beal
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: How to add a ManyToManyField "dynamically" to a model?

2011-12-20 Thread huseyin yilmaz
Generic forign key might help you
https://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#django.contrib.contenttypes.generic.GenericForeignKey
You might not even need a metadata here.(The metadata you need looks
like ContentType model)

Just do

class GenericManyToManyDetail(Model)
ct1 = ...
object_id2 = 
firstModel = GenericForeignKey()

ct2 = ...
object_id2 = ..
secondModel = GenericForeignKey()

This table can represent any many to many relation you want.

Or you could just use django-generic-m2m

https://github.com/coleifer/django-generic-m2m

On Dec 20, 12:58 pm, Hanne Moa  wrote:
> I have some apps app1, app2, .. appN and a special app for metadata.
> The model metadata.Metadata should have ManyToManyFields to models (to
> primary key, nothing fancy) in some of the other apps. I don't want to
> have to update the models of the existing apps and the apps/models
> shouldn't be hard-coded in the metadata-app in any way.
>
> Now, one way I want very much to avoid is to make another app, let's
> call it "glue", that hardcodes one model per wanted ManyToManyField
> like so:
>
> class GlueModel1Metadata(Model):
>     model1 = ManyToManyField(Model1)
>     metadata =  ManyToManyField(Metadata)
>
> I've figured out how to "dynamically" create a Through-style model
> (like the above) but I don't want them to be Through-style models.
> (Dynamically is in quotes because I don't need to make tables at
> runtime. Making them up front through syncdb is fine.)
>
> Instead I'd rather register the models that need a manytomany to
> Metadata and create all the connection tables in one fell swoop, via
> syncdb, so I get that bit out of the way.
>
> But... I'm stumped. The examples from AuditTrail at the wiki and the
> revision history stuff in Pro Django is for full-blown models, not
> ManyToMany tables. Besides, the models that are to use the audit
> trail/history have that fact hardcoded in.
>
> HM . o 0 ( monkey patch! )

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



new tables missing from admin page

2011-12-20 Thread Bill Beal
Hi all,

I added some tables to models.py but they didn't show up
when I logged in as admin.  I knew already from harsh
experience that syncdb will not pick up _changes_ to an
existing table, so I deleted the old database before doing
syncdb then runserver.  When I didn't find the new tables
listed on the admin page, I shut down the server, blew
away all .pyc files in the project and app directories, then
ran runserver again.  Tables were still missing from admin.
sqlall showed the new tables.  dbshell with .tables
command showed the new tables.  I'm using Python 2.6.6,
Django 1.3, SQLite 3.7.2.  What's the missing link? How
can there be any file left that only has the old tables?

Bill Beal

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



DjangoCon Europe 2012: June 4-6, in Zürich, Switzerland

2011-12-20 Thread Jonas Obrist
Hi all,

We are excited to announce the dates for DjangoCon Europe 2012. The 
conference will be held in Zürich, Switzerland from June 4th to June 6th 
2012, followed by two days of sprints.

The conference will be at Stadion Letzigrund [1] and the sprints will be at 
Cigarettenfabrik Zürich directly at the river.

We have not yet finalized our budget, but we will announce the ticket 
prices as soon as we know them.

We also launched our website, which you can find at 2012.djangocon.eu where 
we will keep you up to date. Also make sure you follow @djangocon on 
twitter.

Looking forward to see you in Zürich in June!

Yours,

Jonas Obrist

[1] http://www.stadionletzigrund.ch/

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



ModelForms and ProcessFormViews w models containing BooleanFields

2011-12-20 Thread Jeff Heard
I feel like this should be obvious but I can't figure it out.  When
creating a ProcessFormView or a ModelForm on a model with a BooleanField
somewhere in, I get the classic problem of "This field is required" in the
actual rendered page.  Is there some way to turn off this behaviour and
make the fields editable?  I know in a regular form, you specify a
BooleanField(required=False) for all your boolean fields, but since the
ModelForms and in particular the ProcessFormViews are automatically
generated from the model, I can't seem to do that.

-- Jeff

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Which IDE should I use for Django?

2011-12-20 Thread Parisson
On 20/12/2011 08:23, Alex Mandel wrote:
> Code completion is subpar, actually one of the worst python editors for
> that because you have to pregenerate the lists.
> 

Eric's completion is based on QScintilla and works fast here..
Do you know any completion system which doesn't have to generate any word list ?

G

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Which IDE should I use for Django?

2011-12-20 Thread Patricio Valarezo L.
1+
-- 
Enviado desde mi teléfono Android con K-9 Mail. Disculpa mi brevedad

Vikas Ruhil  escribió:

Go for Vim it is great for django  you really feel like a superuser , just 
search Google Vim as python Modern IDE !! 

On Tue, Dec 20, 2011 at 12:42 PM, huseyin yilmaz  
wrote:

I was going to say emacs, but since you also use windows, Aptana would
be a better fit.


On Dec 19, 12:34 pm, Alec Taylor  wrote:
> I'm looking for a Django IDE which incorporates the following features:
> - Syntax-highlighting
> - Projects (all code file of the project shown separated by directory
> in a sidebar)
> - Tabs (with close buttons on tab)
> - Code-completion (with good introspection)
> - Text-zoom support
> - Start/stop Django server
> - Run+restart Django server shell (manage.py shell) in project (i.e. below 
> code)
>
> I program on Windows and Linux, so it would be great if the IDE is
> supported on both platforms.
>
> Previously I was using Editra, but I requested an automatic import
> into embedded interpreter feature in April, which they still haven't
> integrated. So I am looking at alternatives :)
>
> Thanks for all suggestions,
>
> Alec Taylor

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




-- 

Thanks & Regards, 
Vikash Ruhil | CTO | Mob : +91-97174-82118 | Ph : +91-11-27581821  | Website: 
www.ruasys.com
Connect With Me:   TwitterLinkedIn Tungle.meBlog RSS
Contact me:  vikasru...@ruasys.com |   vikas.ruhil | vikasruhi...@gmail.com

 

 

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.ruasys.com 


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

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Gallery plugin

2011-12-20 Thread Tomas Neme
I've got my own https://github.com/Lacrymology/cmsplugin_s3slider
which works for http://www.serie3.info/s3slider/ out of the box, and
the plugin I forked from is nice, too

-- 
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Cascading Select Input Boxes (peek into request data)

2011-12-20 Thread Thomas Guettler

On 20.12.2011 11:59, Thomas Guettler wrote:

Hi,

I have three cascading select input fields. I data is different, but for 
example: state, city and street. They
are all ModelChoiceFields.

With jquery and view returning json, it is very easy to fill "city" if you select 
"state".

But if the form gets submitted, and only "state" and "city" are filled, I want 
to display
the form again.

Up to now, I almost never use request.GET or request.POST and always use 
form.cleaned_data.

But here you need to peek into request.POST, since I want to fill "state" 
before the form gets cleaned.



I posted my solution here:

http://stackoverflow.com/questions/3233850/django-jquery-cascading-select-boxes/8575346#8575346



--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Which IDE should I use for Django?

2011-12-20 Thread Masklinn
On 2011-12-20, at 09:51 , Alex Mandel wrote:
> On 12/20/2011 12:40 AM, Masklinn wrote:
>> On 2011-12-20, at 08:30 , Alex Mandel wrote:
>>> For the most part commercial editors are off the list too because many
>>> of them are more than $100 a license per year which is too expensive for
>>> a university lab of 20 people where most of the people only write short
>>> scripts. If you code for a living in the tech world and get paid
>>> decently I can see why PyCharm or WingIDE would be great options.
>> Correction w.r.t. PyCharm pricing: the personal license is $99 and upgrade 
>> subscription renewals are $59/year (so it's below $100/year past the first 
>> year). And for university labs, you'd probably qualify for either Academic 
>> ($29/$19) or Classroom ("for educational and teaching uses in classrooms, by 
>> professors, trainers, and students.", $0) licenses. Although I would agree 
>> PyCharm is way overkill for "short scripts".
> I'll have to revisit that since I thought it was Windows only but I
> clearly see Mac and Linux downloads on sub pages.
Yes it's supported both basically forever (since the underlying platform 
supports them), I've been using it on OSX since the 1.0 EAP.

> Any idea if it
> supports virtualenv?
It does, since 2.0 (maybe even 1.5 I don't remember) it even auto-detects 
virtualenvs and automatically adds them to its list of Python interpreters when 
you open a directory containing a virtual environment: 
http://youtrack.jetbrains.com/issue/PY-710

Only mis-support is that virtualenvs are added to the list of "global" 
interpreters, and PyCharm will whine if you remove a virtualenv from your FS 
before removing it from PyCharm. But apart from that it works really well, all 
my work is done in virtualenvs.

Future versions should also be able to install packages in your venvs from 
PyCharm directly.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Which IDE should I use for Django?

2011-12-20 Thread Joey Espinosa
Please start a new thread for your other problem.
--
Joey "JoeLinux" Espinosa*
*





On Tue, Dec 20, 2011 at 1:57 AM, Rayner Pailus wrote:

> Thanks Man...
>
> However, now I have another puzzle that I need to solve. thank you...
> it is good to know that you guys are there to help ... us...thanks
> again..
>
> IndexVersionError at /forum/3/topic/add/
> Can't read format -110
>
>
> Request Method:
>
> POST
> Request URL:
>
> http://forum.cseap.com/forum/3/topic/add/
>
> Django Version:1.3
>
> Exception Type:
>
> IndexVersionError
>
> Exception Value:
>
> Can't read format -110
>
> Exception Location:
>
>
> /usr/lib/python2.5/site-packages/Whoosh-1.2.0-py2.5.egg/whoosh/filedb/fileindex.py
> in _read_toc, line 134
>
> Python Executable:
>
> /usr/bin/python
>
> Python Version:
>
> 2.5.2
>
>
> On Tue, Dec 20, 2011 at 9:52 AM, kenneth gonsalves
>  wrote:
> > On Tue, 2011-12-20 at 02:23 +1100, Alec Taylor wrote:
> >> I am testing each of the ones thus far recommended (even though I hate
> >> Eclipse with a vengeance :3). My results you'll find succeeding: [pun
> >> intended!]
> >
> > could you put the results in the wiki as and when you test. I personally
> > am getting a bit tired of the frequent threads on this subject (must
> > have crossed a hundred by now). btw I vote for geany.
> > --
> > regards
> > Kenneth Gonsalves
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Which IDE should I use for Django?

2011-12-20 Thread Rayner Pailus
Thanks Man...

However, now I have another puzzle that I need to solve. thank you...
it is good to know that you guys are there to help ... us...thanks
again..

IndexVersionError at /forum/3/topic/add/
Can't read format -110


Request Method:

POST
Request URL:

http://forum.cseap.com/forum/3/topic/add/

Django Version:1.3

Exception Type:

IndexVersionError

Exception Value:

Can't read format -110

Exception Location:

/usr/lib/python2.5/site-packages/Whoosh-1.2.0-py2.5.egg/whoosh/filedb/fileindex.py
in _read_toc, line 134

Python Executable:

/usr/bin/python

Python Version:

2.5.2


On Tue, Dec 20, 2011 at 9:52 AM, kenneth gonsalves
 wrote:
> On Tue, 2011-12-20 at 02:23 +1100, Alec Taylor wrote:
>> I am testing each of the ones thus far recommended (even though I hate
>> Eclipse with a vengeance :3). My results you'll find succeeding: [pun
>> intended!]
>
> could you put the results in the wiki as and when you test. I personally
> am getting a bit tired of the frequent threads on this subject (must
> have crossed a hundred by now). btw I vote for geany.
> --
> regards
> Kenneth Gonsalves
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, 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.



Cascading Select Input Boxes (peek into request data)

2011-12-20 Thread Thomas Guettler

Hi,

I have three cascading select input fields. I data is different, but for 
example: state, city and street. They
are all ModelChoiceFields.

With jquery and view returning json, it is very easy to fill "city" if you select 
"state".

But if the form gets submitted, and only "state" and "city" are filled, I want 
to display
the form again.

Up to now, I almost never use request.GET or request.POST and always use 
form.cleaned_data.

But here you need to peek into request.POST, since I want to fill "state" 
before the form gets cleaned.

Not impossible, but not nice since I need to support form prefixes, too.


In forms.py there is _raw_value():
 Returns the raw_value for a particular field name. This is just a
 convenient wrapper around widget.value_from_datadict.

How do you handle "peeking into the request-data"? I think _raw_value() should 
be in the public API.

  Thomas




--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

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



How to add a ManyToManyField "dynamically" to a model?

2011-12-20 Thread Hanne Moa
I have some apps app1, app2, .. appN and a special app for metadata.
The model metadata.Metadata should have ManyToManyFields to models (to
primary key, nothing fancy) in some of the other apps. I don't want to
have to update the models of the existing apps and the apps/models
shouldn't be hard-coded in the metadata-app in any way.

Now, one way I want very much to avoid is to make another app, let's
call it "glue", that hardcodes one model per wanted ManyToManyField
like so:

class GlueModel1Metadata(Model):
model1 = ManyToManyField(Model1)
metadata =  ManyToManyField(Metadata)

I've figured out how to "dynamically" create a Through-style model
(like the above) but I don't want them to be Through-style models.
(Dynamically is in quotes because I don't need to make tables at
runtime. Making them up front through syncdb is fine.)

Instead I'd rather register the models that need a manytomany to
Metadata and create all the connection tables in one fell swoop, via
syncdb, so I get that bit out of the way.

But... I'm stumped. The examples from AuditTrail at the wiki and the
revision history stuff in Pro Django is for full-blown models, not
ManyToMany tables. Besides, the models that are to use the audit
trail/history have that fact hardcoded in.


HM . o 0 ( monkey patch! )

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Which IDE should I use for Django?

2011-12-20 Thread Alex Mandel
On 12/20/2011 12:40 AM, Masklinn wrote:
> On 2011-12-20, at 08:30 , Alex Mandel wrote:
>> For the most part commercial editors are off the list too because many
>> of them are more than $100 a license per year which is too expensive for
>> a university lab of 20 people where most of the people only write short
>> scripts. If you code for a living in the tech world and get paid
>> decently I can see why PyCharm or WingIDE would be great options.
> Correction w.r.t. PyCharm pricing: the personal license is $99 and upgrade 
> subscription renewals are $59/year (so it's below $100/year past the first 
> year). And for university labs, you'd probably qualify for either Academic 
> ($29/$19) or Classroom ("for educational and teaching uses in classrooms, by 
> professors, trainers, and students.", $0) licenses. Although I would agree 
> PyCharm is way overkill for "short scripts".
> 

I'll have to revisit that since I thought it was Windows only but I
clearly see Mac and Linux downloads on sub pages. Any idea if it
supports virtualenv?

Thanks,
Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: User Profile Creation

2011-12-20 Thread Piotr Zalewa

You can't do it in admin site without tinkering.
If you create users inside a view (i.e. during the registration 
process), there is no need to use signals - you can simply create a 
profile with data from registration form.


If you use django forms, use them with prefix kwarg, this will allow to 
simply divide request to User and Profile fields.


https://docs.djangoproject.com/en/dev/ref/forms/api/#prefixes-for-forms

zalun

On 12/15/11 22:46, bazaarsoft wrote:

In all the examples I've seen of creating the user profile at the time
a User is created, I always see the use of the signal and the profile
table's fields (except for user) have to be nullable. I don't see a
way to break in to the creation process using the signal scheme such
that you can pass in valid data for initial creation. I have all the
form elements for both the User object an my profile object - I just
can't get them to my version of the create_profile method.

Is this correct - a user profile can't have any required fields
(required in the model) except user because the only way to create it
is through the signal?



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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 south and new installed app how to?

2011-12-20 Thread Piotr Zalewa

Explained here: http://south.aeracode.org/docs/commands.html#schemamigration


On 12/15/11 15:58, Gijsbert de Haan wrote:

Hi,
I have an existing django project with south enabled using buildout. Now
I want to add a new egg to get and install another django application
for my project, this new application needs models, and thus needs tables
to be created.
My question: is it possible to have these tables created via South? That
way my current deployment system, which uses South migrations to do
database schema changes, could also handle this new application.
I have tried to run manage.py schemamigrate newapp and migrate (newapp)
but that creates files in the eggs directory, which I prefer not to add
to my source control system.
Any advice on how to do this properly?
Thanks,
Gijsbert

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/ZewQKq1UiE8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Serving Django Admin Static Media Files with Apache WSGI on Ubuntu

2011-12-20 Thread Timothy Makobu
Also, here is a working wsgi settings file:

***

import os
import sys

sys.path.append(os.path.dirname(__file__).replace('\\','/'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

from django.core.handlers.wsgi import WSGIHandler

application = WSGIHandler()

***


On Tue, Dec 20, 2011 at 11:39 AM, Timothy Makobu <
makobu.mwambir...@gmail.com> wrote:

> The way I do it, is I use the staticfilesapp
> https://docs.djangoproject.com/en/dev/howto/static-files/
> then i have the web server use the static folder in my project folder to
> serve requests for /static
>
> works well on ep.io
>
>
>
> On Tue, Dec 20, 2011 at 10:58 AM, Ganesh Kumar  wrote:
>
>> Hi guys, I trying with Serving Django Admin Static Media Files with
>> Apache WSGI on Ubuntu.10.04
>>
>> This my config files. example_proj.wsgi
>> http://dpaste.com/675674/
>>
>> apache config file. 000-default
>>
>> http://dpaste.com/675675/
>>
>> my setting.py
>>
>> http://dpaste.com/675678/
>>
>> please guide me. what mistakes I have do it.
>>
>> -Ganesh
>>
>>
>> Did I learn something today? If not, I wasted 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.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Which IDE should I use for Django?

2011-12-20 Thread Masklinn
On 2011-12-20, at 08:30 , Alex Mandel wrote:
> For the most part commercial editors are off the list too because many
> of them are more than $100 a license per year which is too expensive for
> a university lab of 20 people where most of the people only write short
> scripts. If you code for a living in the tech world and get paid
> decently I can see why PyCharm or WingIDE would be great options.
Correction w.r.t. PyCharm pricing: the personal license is $99 and upgrade 
subscription renewals are $59/year (so it's below $100/year past the first 
year). And for university labs, you'd probably qualify for either Academic 
($29/$19) or Classroom ("for educational and teaching uses in classrooms, by 
professors, trainers, and students.", $0) licenses. Although I would agree 
PyCharm is way overkill for "short scripts".

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Serving Django Admin Static Media Files with Apache WSGI on Ubuntu

2011-12-20 Thread Timothy Makobu
The way I do it, is I use the staticfilesapp
https://docs.djangoproject.com/en/dev/howto/static-files/
then i have the web server use the static folder in my project folder to
serve requests for /static

works well on ep.io


On Tue, Dec 20, 2011 at 10:58 AM, Ganesh Kumar  wrote:

> Hi guys, I trying with Serving Django Admin Static Media Files with
> Apache WSGI on Ubuntu.10.04
>
> This my config files. example_proj.wsgi
> http://dpaste.com/675674/
>
> apache config file. 000-default
>
> http://dpaste.com/675675/
>
> my setting.py
>
> http://dpaste.com/675678/
>
> please guide me. what mistakes I have do it.
>
> -Ganesh
>
>
> Did I learn something today? If not, I wasted 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.
>
>

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



Serving Django Admin Static Media Files with Apache WSGI on Ubuntu

2011-12-20 Thread Ganesh Kumar
Hi guys, I trying with Serving Django Admin Static Media Files with
Apache WSGI on Ubuntu.10.04

This my config files. example_proj.wsgi
http://dpaste.com/675674/

apache config file. 000-default

http://dpaste.com/675675/

my setting.py

http://dpaste.com/675678/

please guide me. what mistakes I have do it.

-Ganesh


Did I learn something today? If not, I wasted 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.