Re: Caught ViewDoesNotExist while rendering: Could not import smsnotifications.views. Error was: No module named forms

2010-06-28 Thread Allen Machary
Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.3 pre-alpha
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.gis',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.markup',
 'domain',
 'testcal',
 'buildmanager',
 'httptester',
 'locations',
 'django_tables',
 'wqm',
 'django_extensions',
 'graphing',
 'calender',
 'backups',
 'gdata',
 'backends',
 'logtracker',
 'samples',
 'gencal',
 'logger',
 'user_registration',
 'docs',
 'hq',
 'smsnotifications',
 'ajax',
 'django_granular_permissions',
 'reporters',
 'webapp',
 'aquaReports',
 'requestlogger',
 'admin',
 'djangogcal',
 'aquatest',
 'reports',
 'standards',
 'patterns',
 'xformmanager',
 'receiver',
 'messaging']
Installed Middleware:
['django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.csrf.CsrfMiddleware',
 'hq.middleware.hq.HqMiddleware',
 'domain.middleware.DomainMiddleware']


Template error:
In template
/media/Otoro/Development/python/commcare-hq/apps/hq/templates/hq/partials/header.html,
error at line 10
   Caught ViewDoesNotExist while rendering: Could not import
smsnotifications.views. Error was: No module named forms
   1 : {% load i18n %}


   2 : 


   3 :   {% if user.is_authenticated %}


   4 :   Logged in as {{user}}{% if
user.selected_domain %} in domain {{
user.selected_domain}}{% endif %}|


   5 :   {% ifnotequal user.active_domains|length  1 %}


   6 :   Change
Domain |


   7 :   {% endifnotequal %}


   8 :


   9 :   {% if user.is_selected_dom_admin %}


   10 :   Domain
Settings |


   11 :   {% endif %}


   12 :   Account
Settings |


   13 :   Admin |


   14 :   Help |


   15 :   {% trans
"Log out" %}


   16 :


   17 :   {%else%}


   18 :   {% trans "Log in"
%}


   19 :   {%endif%}


   20 :


Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py"
in get_response
  100. response = callback(request, *callback_args,
**callback_kwargs)
File "apps/domain/decorators.py" in _inner
  85. return view_func(request, *args, **kwargs)
File "apps/hq/views.py" in dashboard
  57. return render_to_response(request, template_name, context)
File "rapidsms/lib/rapidsms/webui/utils.py" in render_to_response
  121. return django_r_to_r(template_name, rs_dict, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/shortcuts/__init__.py"
in render_to_response
  20. return HttpResponse(loader.render_to_string(*args, **kwargs),
**httpresponse_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in
render_to_string
  186. return t.render(context_instance)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
  173. return self._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
  167. return self.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
  796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
  72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py"
in render
  125. return compiled_parent._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
  167. return self.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
  796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
  72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py"
in render
  125. return compiled_parent._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
  167. return self.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
  796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
  72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py"
in render
  125. return compiled_parent._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
  167. return self.nodelist.render(context)
File 

Re: Caught ViewDoesNotExist while rendering: Could not import smsnotifications.views. Error was: No module named forms

2010-06-28 Thread Allen Machary
Sorry on that..
No i have not imported smsnotification.forms in the smsnotification model.
i have from smsnotifications.forms import SmsNotificationForm in the views

I further tried to import the smsnotifications.forms import
SmsNotificationForm in the django shell it worked okey.
but importing views  " from smsnotifications import views"
i get
Traceback (most recent call last):
  File "", line 1, in 
  File "apps/smsnotifications/views.py", line 51, in 
from smsnotifications.forms import SmsNotificationForm
ImportError: No module named forms

but commenting the import of SmsNotificationForm and coding the form
directly to the views works okey..

I further try to removed all other imports..except for from
smsnotifications.forms import SmsNotificationForm
and reduce all the veiw function to pass
ie
def index(request):
   pass
just to see if the import will work and i still get the error..

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

2010-06-28 Thread Jeff
Yes I am using PostgreSQL and I didn't add an order by clause. Adding
the order by clause fixed the problem. Thank you very much Karen!

Jeff

On Jun 28, 10:46 am, Karen Tracey  wrote:
> On Mon, Jun 28, 2010 at 10:37 AM, Jeff  wrote:
> > Hi,
>
> > I have a question concerning some queryset behaviour in Django 1.1.
>
> > In this example, I have an article model that can contain 1 or more
> > authors who are users registered through Django's auth system.
>
> > I get the following output when playing around with an article in a
> > shell where I have three authors:
>
> > >>> article.authors.all()
> > [, , ]
> > >>> article.authors.all()[0]
> > 
> > >>> article.authors.all()[1]
> > 
> > >>> article.authors.all()[2]
> > 
> > >>> article.authors.all()[0:1]
> > []
> > >>> article.authors.all()[1:2]
> > []
> > >>> article.authors.all()[2:3]
> > []
>
> > I'm curious why article.authors.all()[0] does not return 
> > and instead returns . I'm also curious as to why  > jeff> appears twice when slicing queries and it doesn't when
> > requesting all results.
>
> > Thank you in advance for your time!
>
> I'm guessing you are using PostgreSQL? And you have no ordering specified on
> the authors model? This is typical behavior for that situation. These
> queries pull results from the DB by using OFFSET and LIMIT...if there is no
> ORDER BY in the query then the DB can (and PostgreSQL definitely will)
> return "unpredictable" results for them.  
> See:http://developer.postgresql.org/pgdocs/postgres/queries-limit.html
>
> 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How To Create POST data without an actual POST?

2010-06-28 Thread Gabriel Gayan
Maybe trying with ajax?

jquery has some nice functions to deal with ajax post requests.

You can even send files via ajax.

>From the server side, you could return JSON objects and parse them on the
client (for validation).

Cheers

On Mon, Jun 28, 2010 at 4:22 PM, Margie Roginski
wrote:

> I'd like to find a way to let my users submit form data without
> submitting
> it via an actual web form. For example, I have users that would like
> to
> send their data via email, or perhaps provide it in an excel spread
> sheet,
>
> I'm trying to figure out how to do this and still leverage all the
> error
> checking associated with my forms (ie, via is_valid).
>
> I'm thinking that on the server side I could create a form with
> initial data,
> and then instead of rendering that form, I'd like to just convert it
> directly
> to a POST data dict, as if the user submitted the form without making
> any changes. Then I'd take that POST data, add a bit of additinal
> data
> that I've gotten from some other source (ie from email or excel), then
> run
> is_valid(), then do my standard save to my db object.
>
> Can anyone comment on if this seems like a good approach for doing
> this,
> and if so, if there is any django support for turning a form directly
> into a data dict?
>
> Thanks!
> Margie
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Gabriel Gayan

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

2010-06-28 Thread Jason Mayfield
Backends are not in the version available via easy_install or pip, so
either way you need to get the code from bitbucket.  The latest code
in the repository is perfectly stable.

On Jun 28, 9:13 am, Alexandre González  wrote:
> I read in the snippet that actual code doesn't emmit signals, but I can do
> it changing the backend, but I don't know where can I start.
>
> Anyway... is it a good way to install a svn code in my production
> enviroment? I suppose that yes, because django-registration SVN will be
> better than my code (for example)... What's you opinion about?
>
> Regards,
> Álex González
>
>
>
>
>
> On Mon, Jun 28, 2010 at 14:42, Jason Mayfield  wrote:
> > As noted in the comments for the snippet you reference, the version of
> > django-registration available via easy_install or pip does not emit
> > signals.  You need to grab the latest unreleased code from bitbucket:
>
> >http://bitbucket.org/ubernostrum/django-registration/
>
> > On Jun 27, 10:34 pm, Alexandre González  wrote:
> > > Hi!
>
> > > I like to autologin the user after they activate their account with the
> > > mail-link.
>
> > > I saw this snippet:http://djangosnippets.org/snippets/1960/butI can't
> > do
> > > it work. I saw the django-registration code and I don't see any emmited
> > > signals.
>
> > > I was reading the django registration documentation and it says that I
> > must
> > > change my backend, but I'm using the default backend and don't know 1)
> > how
> > > configure another backed, 2) the code that must be in this backend.
>
> > > Thanks!
> > > --
> > > Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx,
> > .ppt
> > > and/or .pptxhttp://mirblu.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-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt
> and/or .pptxhttp://mirblu.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



context porcessors request.context media_url breaks admin

2010-06-28 Thread justin jools
I am trying to use media_url with generic views:
When I set context processors to media_url, with generic views it
breaks Admin:

Caught an exception while rendering: user

settings.py
TEMPLATE_CONTEXT_PROCESSORS =
('portfolio.context_processors.media_url',)

context_processors.py
def media_url(request):
from django.conf import settings
return {'media_url': settings.MEDIA_URL}

urls.py
from django.template import RequestContext

urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^work/$', 'django.views.generic.list_detail.object_list',
dict(info_dict, template_name="portfolio/projects_list.html")),
)

and when I remove it the admin works, but I have no media_url
reference

Any suggestions please?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, 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 interface for model with optional 'self' relationship

2010-06-28 Thread Jeff Green
You need to also state that null=True. Also, you want to have ensure that
the field defined in your db
allows null values.

On Mon, Jun 28, 2010 at 3:19 PM, Jonathan Hayward <
christos.jonathan.hayw...@gmail.com> wrote:

> I have a model with two foreign keys to itself:
>
> department = models.ForeignKey(u'self', blank = True, related_name =
> u'member')
> reports_to = models.ForeignKey(u'self', blank = True, related_name =
> u'subordinate')
>
> When I tried to save test data from the admin interface, leaving those
> items blank, I got a ValueError, pasted below. What do I need to be able to
> save test data? I'm willing to assign non-blank values to those fields for
> now, but there's a chicken-and-egg problem if the admin interface won't let
> me save any instances until I already have an instance saved.
>
>  ValueError at /admin/directory/entity/add/
>
> Cannot assign None: "Entity.department" does not allow null values.
>
>   Request Method: POST Request URL:
> http://linux:8000/admin/directory/entity/add/ Exception Type: ValueError 
> Exception
> Value:
>
> Cannot assign None: "Entity.department" does not allow null values.
>
>  Exception Location: 
> /usr/lib/pymodules/python2.6/django/db/models/fields/related.py
> in __set__, line 269 Python Executable: /usr/bin/python Python Version:
> 2.6.5 Python Path: ['/home/jonathan/directory',
> '/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg',
> '/home/jonathan/store/src/satchmo/satchmo/apps',
> '/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
> '/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg',
> '/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg',
> '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
> '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
> '/usr/lib/python2.6/dist-packages/PIL',
> '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6',
> '/usr/lib/python2.6/dist-packages/gtk-2.0',
> '/usr/lib/pymodules/python2.6/gtk-2.0',
> '/usr/local/lib/python2.6/dist-packages'] Server time: Mon, 28 Jun 2010
> 15:13:53 -050
>
> --
> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> → An Orthodox Christian author: theology, literature, et cetera.
> → My award-winning collection is available for free reading online:
> ☩ I invite you to visit my main site at 
> http://JonathansCorner.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-us...@googlegroups.com.
> To unsubscribe from this group, 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-us...@googlegroups.com.
To unsubscribe from this group, 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: can't adapt type 'Decimal'

2010-06-28 Thread poupou
I confirm that everything is working fine now.

Thank you again.

On 25 juin, 13:12, poupou  wrote:
> Yes I'm running two sites on the same server.  Only difference with
> you is that I'm running it with virtual host.
>
> I modifier my Apache config, now it looks like this :
>
> 
>   ServerName  site1.com
>   WSGIDaemonProcess site1
>   WSGIScriptAlias / /var/www/site1.wsgi process-group=site1
> application-group=%{GLOBAL}
>
> 
>
> 
>   ServerName  site2.com
>   WSGIDaemonProcess site2
>   WSGIScriptAlias / /var/www/site2.wsgi process-group=site2
> application-group=%{GLOBAL}
>
> 
>
> It will take a little to make sure it's working, I will report on this
> thread if everything is ok.
>
> Thank you!
>
> On 25 juin, 10:51, Stuart  wrote:
>
>
>
> > On Jun 25, 8:06 am, poupou  wrote:
>
> > >   Of the 2 web site that I have, It only happens where I make request
> > > using the the Q objects.
>
> > If you have two django sites/projects on the same server 
> > (e.g.http://myserver/app1andhttp://myserver/app2) and you are using
> > mod_wsgi, I bet you're having the same problem I was. To fix it,
> > upgrade to the latest version of mod_wsgi and run it in daemon mode.
> > See here for 
> > details:http://groups.google.com/group/satchmo-users/msg/a9b22c236d63c323
>
> > Hope that helps,
>
> > --Stuart

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, 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 Create POST data without an actual POST?

2010-06-28 Thread Margie Roginski
I'd like to find a way to let my users submit form data without
submitting
it via an actual web form. For example, I have users that would like
to
send their data via email, or perhaps provide it in an excel spread
sheet,

I'm trying to figure out how to do this and still leverage all the
error
checking associated with my forms (ie, via is_valid).

I'm thinking that on the server side I could create a form with
initial data,
and then instead of rendering that form, I'd like to just convert it
directly
to a POST data dict, as if the user submitted the form without making
any changes. Then I'd take that POST data, add a bit of additinal
data
that I've gotten from some other source (ie from email or excel), then
run
is_valid(), then do my standard save to my db object.

Can anyone comment on if this seems like a good approach for doing
this,
and if so, if there is any django support for turning a form directly
into a data dict?

Thanks!
Margie

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

2010-06-28 Thread Jonathan Hayward
P.S. This problem did not resurface after I made other changes discussed
elsewhere in the thread; it seems to be secondary damage.

On Mon, Jun 28, 2010 at 2:46 PM, Jonathan Hayward <
christos.jonathan.hayw...@gmail.com> wrote:

> Thanks for pointing me to South. I've glanced over it, but I did have one
> question:
>
> My understanding is that Django will introduce tables for models that have
> been added on a syncdb, but not alter tables for models that have been
> changed. And from a glance at the documentation, it looks like South would
> provide more granularity.
>
> However, it is my understanding that this should have the consequence that
> if you start with a fresh database and run syncdb, then that should result
> in appropriate tables. This might not be a first choice way to update the
> database as normally wiping the database when you implement a schema update
> is not desirable if you have any real data, but my understanding from the
> documentation is that this forceful solution should work. If I'm mistaken,
> I'd like to know both how I presently misunderstand, and what an appropriate
> way is to generate a fresh database with tables matching your models.
>
>
> On Fri, Jun 25, 2010 at 5:25 PM, Mark Linsey  wrote:
>
>> I don't quite understand what changes you made before producing this
>> error, and I'm totally unfamiliar with sqllite.
>>
>> But I do know that for many (really, most) different model changes, just
>> running syncdb will not make the appropriate changes to your tables.  You
>> probably need to look into south migrations.
>>
>> On Fri, Jun 25, 2010 at 2:09 PM, Jonathan Hayward <
>> christos.jonathan.hayw...@gmail.com> wrote:
>>
>>> P.S. Renaming the (SQLite) database file and running syncdb again
>>> produces (basically) the same behavior. I had to do some initialization
>>> things again, but outside of that I got equivalent behavior to what I pasted
>>> below.
>>>
>>> What I am trying to do is create a few instances of the Entity model
>>> defined in my [directory/]models.py. So far I have managed to get them to
>>> show up as an option to manage in the admin interface, but not yet to save
>>> one.
>>>
>>> Should it be looking for directory_models_entity instead of
>>> directory_entity? "entity" seems not to be populated; from the command line
>>> sqlite3:
>>>
>>> sqlite> .tables
>>> auth_group  auth_user_user_permissions
>>> auth_group_permissions  django_admin_log
>>> auth_messagedjango_content_type
>>> auth_permission django_session
>>> auth_user   django_site
>>> auth_user_groups
>>>
>>> On Fri, Jun 25, 2010 at 3:00 PM, Jonathan Hayward <
>>> christos.jonathan.hayw...@gmail.com> wrote:
>>>
 I received the error below from the admin interface; I thought it was
 because I needed to run a syncdb, but stopping the server, running a 
 syncdb,
 and restarting has generated the same error:

 OperationalError at /admin/directory/entity/

 no such table: directory_entity

  Request Method:GET Request URL:
 http://linux:8000/admin/directory/entity/ Exception Type:
 OperationalError Exception Value:

 no such table: directory_entity

 Exception 
 Location:/usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py
 in execute, line 193 Python Executable:/usr/bin/python Python Version:
 2.6.5 Python Path:['/home/jonathan/directory',
 '/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg',
 '/home/jonathan/store/src/satchmo/satchmo/apps',
 '/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
 '/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg',
 '/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg',
 '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
 '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
 '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
 '/usr/lib/python2.6/dist-packages/PIL',
 '/usr/lib/python2.6/dist-packages/gst-0.10', 
 '/usr/lib/pymodules/python2.6',
 '/usr/lib/python2.6/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.6/gtk-2.0',
 '/usr/local/lib/python2.6/dist-packages'] Server time:Fri, 25 Jun 2010
 14:56:26 -0500

 I have an Entity class/model defined in my models.py and want to
 manually create some dummy data in the table. Any suggestions?

 --
 → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
 → An Orthodox Christian author: theology, literature, et cetera.
 → My award-winning collection is available for free reading online:
 ☩ I invite you to visit my main site at http://JonathansCorner.com/

>>>
>>>
>>>
>>> --
>>> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
>>> → An Orthodox Christian author: theology, literature, et cetera.
>>> → My award-winning collection is 

Admin interface for model with optional 'self' relationship

2010-06-28 Thread Jonathan Hayward
I have a model with two foreign keys to itself:

department = models.ForeignKey(u'self', blank = True, related_name =
u'member')
reports_to = models.ForeignKey(u'self', blank = True, related_name =
u'subordinate')

When I tried to save test data from the admin interface, leaving those items
blank, I got a ValueError, pasted below. What do I need to be able to save
test data? I'm willing to assign non-blank values to those fields for now,
but there's a chicken-and-egg problem if the admin interface won't let me
save any instances until I already have an instance saved.

ValueError at /admin/directory/entity/add/

Cannot assign None: "Entity.department" does not allow null values.

Request Method:POSTRequest
URL:http://linux:8000/admin/directory/entity/add/Exception
Type:ValueErrorException Value:

Cannot assign None: "Entity.department" does not allow null values.

Exception 
Location:/usr/lib/pymodules/python2.6/django/db/models/fields/related.py
in __set__, line 269Python Executable:/usr/bin/pythonPython Version:2.6.5Python
Path:['/home/jonathan/directory',
'/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg',
'/home/jonathan/store/src/satchmo/satchmo/apps',
'/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
'/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg',
'/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg',
'/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages/PIL',
'/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6',
'/usr/lib/python2.6/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.6/gtk-2.0',
'/usr/local/lib/python2.6/dist-packages']Server time:Mon, 28 Jun 2010
15:13:53 -050

-- 
→ Jonathan Hayward, christos.jonathan.hayw...@gmail.com
→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading online:
☩ I invite you to visit my main site at http://JonathansCorner.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-us...@googlegroups.com.
To unsubscribe from this group, 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: Looking for unavailable table?

2010-06-28 Thread Jonathan Hayward
Thank you. I've updated my PYTHONPATH and INSTALLED_APPS, and now a syncdb
is reporting errors instead of silently passing on, which seems to mean it's
hitting my code a little more deeply than before.

On Fri, Jun 25, 2010 at 5:57 PM, Oleg Lomaka  wrote:

> Actually it depends on your PYTHONPATH. syncdb scans all modules from
> INSTALLED_APPS looking for models.py in them to populate database. So if you
> access you Entity model (for example at views.py) as
> from directory.models import Entity
> then add 'directory' to INSTALLED_APPS.
>
>
> On Jun 26, 2010, at 1:49 AM, Jonathan Hayward wrote:
>
> > No; that sounds like the issue then?
> >
> > If my project directory is named "directory", and I want to access the
> "Entity" model in "models.py", what do I add to INSTALLED_APPS? I'm guessing
> something like "directory", but I briefly searched online and couldn't tell.
> >
> > On Fri, Jun 25, 2010 at 5:35 PM, Oleg Lomaka 
> wrote:
> >
> > Did you add your application to INSTALLED_APPS before running syncdb?
> >
> > On Jun 26, 2010, at 12:09 AM, Jonathan Hayward wrote:
> >
> > > P.S. Renaming the (SQLite) database file and running syncdb again
> produces (basically) the same behavior. I had to do some initialization
> things again, but outside of that I got equivalent behavior to what I pasted
> below.
> > >
> > > What I am trying to do is create a few instances of the Entity model
> defined in my [directory/]models.py. So far I have managed to get them to
> show up as an option to manage in the admin interface, but not yet to save
> one.
> > >
> > > Should it be looking for directory_models_entity instead of
> directory_entity? "entity" seems not to be populated; from the command line
> sqlite3:
> > >
> > > sqlite> .tables
> > > auth_group  auth_user_user_permissions
> > > auth_group_permissions  django_admin_log
> > > auth_messagedjango_content_type
> > > auth_permission django_session
> > > auth_user   django_site
> > > auth_user_groups
> > >
> > > On Fri, Jun 25, 2010 at 3:00 PM, Jonathan Hayward <
> christos.jonathan.hayw...@gmail.com> wrote:
> > > I received the error below from the admin interface; I thought it was
> because I needed to run a syncdb, but stopping the server, running a syncdb,
> and restarting has generated the same error:
> > >
> > > OperationalError at /admin/directory/entity/
> > > no such table: directory_entity
> > > Request Method:   GET
> > > Request URL:  http://linux:8000/admin/directory/entity/
> > > Exception Type:   OperationalError
> > > Exception Value:
> > > no such table: directory_entity
> > > Exception Location:
> /usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py in execute,
> line 193
> > > Python Executable:/usr/bin/python
> > > Python Version:   2.6.5
> > > Python Path:  ['/home/jonathan/directory',
> '/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg',
> '/home/jonathan/store/src/satchmo/satchmo/apps',
> '/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
> '/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg',
> '/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg',
> '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
> '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
> '/usr/lib/python2.6/dist-packages/PIL',
> '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6',
> '/usr/lib/python2.6/dist-packages/gtk-2.0',
> '/usr/lib/pymodules/python2.6/gtk-2.0',
> '/usr/local/lib/python2.6/dist-packages']
> > > Server time:  Fri, 25 Jun 2010 14:56:26 -0500
> > >
> > > I have an Entity class/model defined in my models.py and want to
> manually create some dummy data in the table. Any suggestions?
> > >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> >
> >
> >
> >
> > --
> > → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> > → An Orthodox Christian author: theology, literature, et cetera.
> > → My award-winning collection is available for free reading online:
> > ☩ I invite you to visit my main site at http://JonathansCorner.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-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> > For more 

Re: Looking for unavailable table?

2010-06-28 Thread Jonathan Hayward
Thanks for pointing me to South. I've glanced over it, but I did have one
question:

My understanding is that Django will introduce tables for models that have
been added on a syncdb, but not alter tables for models that have been
changed. And from a glance at the documentation, it looks like South would
provide more granularity.

However, it is my understanding that this should have the consequence that
if you start with a fresh database and run syncdb, then that should result
in appropriate tables. This might not be a first choice way to update the
database as normally wiping the database when you implement a schema update
is not desirable if you have any real data, but my understanding from the
documentation is that this forceful solution should work. If I'm mistaken,
I'd like to know both how I presently misunderstand, and what an appropriate
way is to generate a fresh database with tables matching your models.

On Fri, Jun 25, 2010 at 5:25 PM, Mark Linsey  wrote:

> I don't quite understand what changes you made before producing this error,
> and I'm totally unfamiliar with sqllite.
>
> But I do know that for many (really, most) different model changes, just
> running syncdb will not make the appropriate changes to your tables.  You
> probably need to look into south migrations.
>
> On Fri, Jun 25, 2010 at 2:09 PM, Jonathan Hayward <
> christos.jonathan.hayw...@gmail.com> wrote:
>
>> P.S. Renaming the (SQLite) database file and running syncdb again produces
>> (basically) the same behavior. I had to do some initialization things again,
>> but outside of that I got equivalent behavior to what I pasted below.
>>
>> What I am trying to do is create a few instances of the Entity model
>> defined in my [directory/]models.py. So far I have managed to get them to
>> show up as an option to manage in the admin interface, but not yet to save
>> one.
>>
>> Should it be looking for directory_models_entity instead of
>> directory_entity? "entity" seems not to be populated; from the command line
>> sqlite3:
>>
>> sqlite> .tables
>> auth_group  auth_user_user_permissions
>> auth_group_permissions  django_admin_log
>> auth_messagedjango_content_type
>> auth_permission django_session
>> auth_user   django_site
>> auth_user_groups
>>
>> On Fri, Jun 25, 2010 at 3:00 PM, Jonathan Hayward <
>> christos.jonathan.hayw...@gmail.com> wrote:
>>
>>> I received the error below from the admin interface; I thought it was
>>> because I needed to run a syncdb, but stopping the server, running a syncdb,
>>> and restarting has generated the same error:
>>>
>>> OperationalError at /admin/directory/entity/
>>>
>>> no such table: directory_entity
>>>
>>>  Request Method:GET Request URL:
>>> http://linux:8000/admin/directory/entity/ Exception Type:
>>> OperationalError Exception Value:
>>>
>>> no such table: directory_entity
>>>
>>> Exception 
>>> Location:/usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py
>>> in execute, line 193 Python Executable:/usr/bin/python Python Version:
>>> 2.6.5 Python Path:['/home/jonathan/directory',
>>> '/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg',
>>> '/home/jonathan/store/src/satchmo/satchmo/apps',
>>> '/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
>>> '/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg',
>>> '/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg',
>>> '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
>>> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
>>> '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
>>> '/usr/lib/python2.6/dist-packages/PIL',
>>> '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6',
>>> '/usr/lib/python2.6/dist-packages/gtk-2.0',
>>> '/usr/lib/pymodules/python2.6/gtk-2.0',
>>> '/usr/local/lib/python2.6/dist-packages'] Server time:Fri, 25 Jun 2010
>>> 14:56:26 -0500
>>>
>>> I have an Entity class/model defined in my models.py and want to manually
>>> create some dummy data in the table. Any suggestions?
>>>
>>> --
>>> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
>>> → An Orthodox Christian author: theology, literature, et cetera.
>>> → My award-winning collection is available for free reading online:
>>> ☩ I invite you to visit my main site at http://JonathansCorner.com/
>>>
>>
>>
>>
>> --
>> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
>> → An Orthodox Christian author: theology, literature, et cetera.
>> → My award-winning collection is available for free reading online:
>> ☩ I invite you to visit my main site at http://JonathansCorner.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-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> 

change displayed name of users object

2010-06-28 Thread Jacob Fenwick
Is there a simple way to change the displayed name of the users object in
the auth package?

I don't care about what it's called under the hood. I just want to change
what the user sees.

I'd like to avoid changing the code directly in the Django library as that
will make upgrades difficult.

I came across this article but it's quite old and I'm hoping there's a
better way:

http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/

Jacob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, 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: More than one primary key for a model

2010-06-28 Thread thusjanthan
Yes you are correct I am looking to implement the compounded primary
keys. Well the problem is I would like to have a many to many(m2m)
with two models that share a compounded primary key. However when I do
the m2m join it randomly pics one of the compounded keys and tries to
join them? :| Does the unique_together parameter fix that problem? as
in does it use the unique_together to do the joins?



On Jun 28, 10:20 am, ringemup  wrote:
> By definition a database table can have only one primary key.  I
> believe what you're looking to implement are compound primary keys.
> Depending on the database backend you're using, the unique_together
> Meta attribute may accomplish most of what you're looking to do.
>
> On Jun 28, 12:49 pm, thusjanthan  wrote:
>
>
>
> > Can anyone tell me why django refuses to follow the rules and lesson
> > we learn in our database courses?
>
> > I have a table that I do not have control over. Suppose its called the
> > phone table and it contains the number and the username as the primary
> > key. But for some reason when I have more than one primary key in
> > django it complains. Especially when I run the test suite it just
> > craps out saying more than one primary key detected for a model. Does
> > django really expect all tables to only contain one primary key? How
> > can I override this feature and have it take more than one primary key
> > without using things suggested by django about the unique attr in the
> > meta info of the model.
>
> > Thanks.
> > Nathan.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, 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: More than one primary key for a model

2010-06-28 Thread ringemup

By definition a database table can have only one primary key.  I
believe what you're looking to implement are compound primary keys.
Depending on the database backend you're using, the unique_together
Meta attribute may accomplish most of what you're looking to do.

On Jun 28, 12:49 pm, thusjanthan  wrote:
> Can anyone tell me why django refuses to follow the rules and lesson
> we learn in our database courses?
>
> I have a table that I do not have control over. Suppose its called the
> phone table and it contains the number and the username as the primary
> key. But for some reason when I have more than one primary key in
> django it complains. Especially when I run the test suite it just
> craps out saying more than one primary key detected for a model. Does
> django really expect all tables to only contain one primary key? How
> can I override this feature and have it take more than one primary key
> without using things suggested by django about the unique attr in the
> meta info of the model.
>
> Thanks.
> Nathan.

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



More than one primary key for a model

2010-06-28 Thread thusjanthan
Can anyone tell me why django refuses to follow the rules and lesson
we learn in our database courses?

I have a table that I do not have control over. Suppose its called the
phone table and it contains the number and the username as the primary
key. But for some reason when I have more than one primary key in
django it complains. Especially when I run the test suite it just
craps out saying more than one primary key detected for a model. Does
django really expect all tables to only contain one primary key? How
can I override this feature and have it take more than one primary key
without using things suggested by django about the unique attr in the
meta info of the model.

Thanks.
Nathan.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, 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 and binding more than one model to a from

2010-06-28 Thread thusjanthan
Hi,

I have a Topic class I would like to create a form based on. BUT, I
want many of these objects so Topics. How do I obtain such a feature.

Suppose my form object is as follows:

class TopicForms(ModelForm):
class meta:
model = Topic
fields = ('topic_id','topic')

I want to display more than one of the topics that is associated to a
particular object. Suppose its a topic about obama and there are 10
topics. I want to display all 10 of these. and If they make a change
to one of them I would like to save that change on submission. I would
also like to provide additional blank topic fields for end users to
enter new topics about obama. Any help would be appreciated. I am a
little confused on the forms area of django.

Nathan.

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

2010-06-28 Thread Tom Evans
On Fri, Jun 25, 2010 at 6:31 PM, thusjanthan  wrote:
> The quick answer is you have to put the following in your template
> right after the  declaration:
>
>  {% csrf_token %}
>
> Cheers,
> Nathan.
>

And how precisely will that make his browser submit the form in a
manner that django can decipher? He gets a CSRF error not because the
token is not in the form, but because he has configured his form to
instruct the browser to submit the data to the server in an
unsupported format.

Cheers

Tom

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

2010-06-28 Thread Karen Tracey
On Mon, Jun 28, 2010 at 10:37 AM, Jeff  wrote:

> Hi,
>
> I have a question concerning some queryset behaviour in Django 1.1.
>
> In this example, I have an article model that can contain 1 or more
> authors who are users registered through Django's auth system.
>
> I get the following output when playing around with an article in a
> shell where I have three authors:
>
> >>> article.authors.all()
> [, , ]
> >>> article.authors.all()[0]
> 
> >>> article.authors.all()[1]
> 
> >>> article.authors.all()[2]
> 
> >>> article.authors.all()[0:1]
> []
> >>> article.authors.all()[1:2]
> []
> >>> article.authors.all()[2:3]
> []
>
> I'm curious why article.authors.all()[0] does not return 
> and instead returns . I'm also curious as to why  jeff> appears twice when slicing queries and it doesn't when
> requesting all results.
>
> Thank you in advance for your time!
>

I'm guessing you are using PostgreSQL? And you have no ordering specified on
the authors model? This is typical behavior for that situation. These
queries pull results from the DB by using OFFSET and LIMIT...if there is no
ORDER BY in the query then the DB can (and PostgreSQL definitely will)
return "unpredictable" results for them.  See:
http://developer.postgresql.org/pgdocs/postgres/queries-limit.html

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



QuerySet Behaviour Question (Django 1.1)

2010-06-28 Thread Jeff
Hi,

I have a question concerning some queryset behaviour in Django 1.1.

In this example, I have an article model that can contain 1 or more
authors who are users registered through Django's auth system.

I get the following output when playing around with an article in a
shell where I have three authors:

>>> article.authors.all()
[, , ]
>>> article.authors.all()[0]

>>> article.authors.all()[1]

>>> article.authors.all()[2]

>>> article.authors.all()[0:1]
[]
>>> article.authors.all()[1:2]
[]
>>> article.authors.all()[2:3]
[]

I'm curious why article.authors.all()[0] does not return 
and instead returns . I'm also curious as to why  appears twice when slicing queries and it doesn't when
requesting all results.

Thank you in advance for your time!

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

2010-06-28 Thread Tom Evans
On Sun, Jun 27, 2010 at 10:50 AM, Rusty Shackleford
 wrote:
> Hi,
>
> I'm about to deploy my first Django app, but I have a few questions
> about permissions.
>
> The project container is at '/usr/local/sites' with '775 root www-
> data'.
>
> I have the project stored at '/usr/local/sites/project'  with '755 www-
> data www-data'.
>
> I have NGINX aliased to '/usr/local/sites/project/static' with '755
> www-data www-data' for static content.
>
> Are these permissions reasonable?
>
> Rusty
>

They are fine ... but ...

As you are thinking about permissions, these permissions would allow
an attacker who managed to compromise a web app running as www-data to
alter the project code.

A way to mitigate that risk is to have the owner of these files as a
separate role user, eg -services, with the group as www-data,
and with permissions u+rw,g+r,a-rw (user read/write, group read,
everyone else can get stuffed).

If you run many web apps on the one box, you could also use a
completely separate user to run the app, and communicate over FastCGI
with TCP/IP. That way, the only way a compromised web app could lead
to an attacker reading your project files would be if it was your web
app that was compromised.

I wouldn't agree with the poster who suggested that 'As long as the
last number is 4 or greater (at least read access for
all) you should be fine' - that will allow it to run, for sure, but
you can be more secure with just a little thought, so why not?

Cheers

Tom

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



Re: Error using inline displays with a user profile

2010-06-28 Thread derek
On Jun 27, 8:06 pm, Karen Tracey  wrote:
> On Sun, Jun 27, 2010 at 1:54 PM, derek  wrote:
> > File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
> > options.py" in change_view
> >  900.                 change_message =
> > self.construct_change_message(request, form, formsets)
> > File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
> > options.py" in construct_change_message
> >  566.                                              'object':
> > force_unicode(added_object)})
> > File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py"
> > in force_unicode
> >  66.                 s = unicode(s)
>
> > Exception Type: TypeError at /admin/auth/user/1/
> > Exception Value: coercing to Unicode: need string or buffer, NoneType
> > found
>
> This traceback shows the admin attempting to create a change message for the
> change history log. It's calling unicode() on the added object, but running
> into trouble because the __unicode__ method for whatever object was added is
> apparently returning None. Check the __unicode__ method for whatever type of
> object you were adding here -- it appears to return None (at least in some
> cases), which is not valid for a __unicode__ method. These methods must
> return unicode or something that can be coerced to unicode (string or
> buffer).
>
> Karen
> --http://tracey.org/kmt/

It appears the error was on the def __unicode__(self) method for the
UserProfile.  Whatever I add there causes this error to be triggered;
conversely, removing the method removes the problem.  So that's the
cause... I will try and figure out a solution.

Thanks
Derek

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

2010-06-28 Thread Rufman
disregard. the problem solved itself...there must have been something
left behind from before. after deleting all .pyc files and restarting
the server it worked


On Jun 28, 2:27 pm, Karen Tracey  wrote:
> On Mon, Jun 28, 2010 at 8:10 AM, Rufman  wrote:
> > for some reason i get a template syntax error when i use the url tag:
>
> > export
>
> > export is the name of a url. I have added the url() function to all
> > url.py files.
>
> The url tag certainly works, so the "some reason" lies in information you
> have not included in your post, such as the specifics of the error (contents
> of the text box when you click on the link to switch to copy-and-paste view
> on the debug page) and what exactly you have in your urls.py. Without that
> information it is going to be difficult for anyone to point you in the right
> direction.
>
> 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-us...@googlegroups.com.
To unsubscribe from this group, 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: Autologin after activation in django-registration

2010-06-28 Thread Alexandre González
I read in the snippet that actual code doesn't emmit signals, but I can do
it changing the backend, but I don't know where can I start.

Anyway... is it a good way to install a svn code in my production
enviroment? I suppose that yes, because django-registration SVN will be
better than my code (for example)... What's you opinion about?

Regards,
Álex González

On Mon, Jun 28, 2010 at 14:42, Jason Mayfield  wrote:

> As noted in the comments for the snippet you reference, the version of
> django-registration available via easy_install or pip does not emit
> signals.  You need to grab the latest unreleased code from bitbucket:
>
> http://bitbucket.org/ubernostrum/django-registration/
>
> On Jun 27, 10:34 pm, Alexandre González  wrote:
> > Hi!
> >
> > I like to autologin the user after they activate their account with the
> > mail-link.
> >
> > I saw this snippet:http://djangosnippets.org/snippets/1960/but I can't
> do
> > it work. I saw the django-registration code and I don't see any emmited
> > signals.
> >
> > I was reading the django registration documentation and it says that I
> must
> > change my backend, but I'm using the default backend and don't know 1)
> how
> > configure another backed, 2) the code that must be in this backend.
> >
> > Thanks!
> > --
> > Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx,
> .ppt
> > and/or .pptxhttp://mirblu.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-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt
and/or .pptx
http://mirblu.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with static files (MEDIA_URL and MEDIA_ROOT)

2010-06-28 Thread nadae ivar badio
Hi do you speack french?

2010/6/27 Denis Ricardo 

> Hello people! I am having any problems with static files (images, CSS)
> in Django. I configured the MEDIA_URL and MEDIA_ROOT in settings.py
> and when I execute the server and I go see the webpage, the static
> files doesn't are encountered (the page stay without anything).
>
> Screen Shot of my page: http://yfrog.com/jq35546894
>
> I am using the Django 1.1, on Ubuntu 10.04. The following are the
> server logs:
>
> http://dpaste.com/211961/
>
> This files exists! They are in this directory, but doesn't are
> encountered by the Django.
> The directory of my project follows below:
>
> http://dpaste.com/211962/
>
> And these are the files of project:
>
> settings.py: http://dpaste.com/211967/
>
> urls.py: http://dpaste.com/211964/
>
> views.py: http://dpaste.com/211969/
>
> base.html: http://dpaste.com/211971/ # This is the page of the Screen
> Shot
>
> Anybody can help me?
>
> (Sorry by my bad english.)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, 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-us...@googlegroups.com.
To unsubscribe from this group, 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: Autologin after activation in django-registration

2010-06-28 Thread Jason Mayfield
As noted in the comments for the snippet you reference, the version of
django-registration available via easy_install or pip does not emit
signals.  You need to grab the latest unreleased code from bitbucket:

http://bitbucket.org/ubernostrum/django-registration/

On Jun 27, 10:34 pm, Alexandre González  wrote:
> Hi!
>
> I like to autologin the user after they activate their account with the
> mail-link.
>
> I saw this snippet:http://djangosnippets.org/snippets/1960/but I can't do
> it work. I saw the django-registration code and I don't see any emmited
> signals.
>
> I was reading the django registration documentation and it says that I must
> change my backend, but I'm using the default backend and don't know 1) how
> configure another backed, 2) the code that must be in this backend.
>
> Thanks!
> --
> Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt
> and/or .pptxhttp://mirblu.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-us...@googlegroups.com.
To unsubscribe from this group, 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: Jaspersoft or Pentaho with Django?

2010-06-28 Thread meitham
On Jun 25, 5:30 pm, zweb  wrote:
> Are there any Python equivalent of Jaspersoft/Pentaho?
The guy who founded informatica is a python developer. He now runs his
own ETL company and his solutions are Python built, its on
https://www.snaplogic.org/trac
I am a bit confused with your question, django is a web framework
while both these solutions you mentioned are ETL tools. what is the
link? May be I could help more if you could explain.
Meitham

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

2010-06-28 Thread Karen Tracey
On Mon, Jun 28, 2010 at 8:10 AM, Rufman  wrote:

> for some reason i get a template syntax error when i use the url tag:
>
> export
>
> export is the name of a url. I have added the url() function to all
> url.py files.
>

The url tag certainly works, so the "some reason" lies in information you
have not included in your post, such as the specifics of the error (contents
of the text box when you click on the link to switch to copy-and-paste view
on the debug page) and what exactly you have in your urls.py. Without that
information it is going to be difficult for anyone to point you in the right
direction.

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-us...@googlegroups.com.
To unsubscribe from this group, 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: Deployment Permissions

2010-06-28 Thread Scott Gould
As long as the last number is 4 or greater (at least read access for
all) you should be fine.

Regards
Scott

On Jun 27, 5:50 am, Rusty Shackleford 
wrote:
> Hi,
>
> I'm about to deploy my first Django app, but I have a few questions
> about permissions.
>
> The project container is at '/usr/local/sites' with '775 root www-
> data'.
>
> I have the project stored at '/usr/local/sites/project'  with '755 www-
> data www-data'.
>
> I have NGINX aliased to '/usr/local/sites/project/static' with '755
> www-data www-data' for static content.
>
> Are these permissions reasonable?
>
> Rusty

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

2010-06-28 Thread Filip Gruszczyński
> You can just define `template` in your inlineadmin class:
>
>    class MyInlineAdmin(admin.InlineModelAdmin):
>        template = 'mytemplates/myinlinetemplate.html'
>        model = MyModel

I'll try this. Thanks a lot.

-- 
Filip Gruszczyński

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

2010-06-28 Thread Daniel Roseman
On Jun 28, 12:16 pm, Filip Gruszczyński  wrote:
> I would like to inject my own admin template instead of a standard
> inline for a certain model (this model has additional reference, that
> can't be edited by traditional inline). Could someone suggest me, how
> I could achieve this?

You can just define `template` in your inlineadmin class:

class MyInlineAdmin(admin.InlineModelAdmin):
template = 'mytemplates/myinlinetemplate.html'
model = MyModel

--
DR.

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



Own template instead of a inline

2010-06-28 Thread Filip Gruszczyński
I would like to inject my own admin template instead of a standard
inline for a certain model (this model has additional reference, that
can't be edited by traditional inline). Could someone suggest me, how
I could achieve this?

-- 
Filip Gruszczyński

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

2010-06-28 Thread Allen Machary
Hi Eduan
I looks like you have not added your polls app in the Settings.py
file.
Open your setting.py file
find the installed apps.. which will look something like this.
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
)

Now you have to add your polls app to the tuple of installed apps.
So should look somthing similar to this.
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'mysite.polls',
)

Allen M.

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

2010-06-28 Thread Massimiliano della Rovere
Yes that's my idea.
Can you tell me which class/method in the admin files is responsible
for the search engine so that I can extend it?

On Mon, Jun 28, 2010 at 10:27, euan.godd...@googlemail.com
 wrote:
> I think that would be quite an undertaking as you would need to write
> an expression parser and monkey around with the search code in admin.
>
> If you succeed, I'd be interested to see the result.
>
> Euan
>
> On Jun 28, 8:36 am, Massimiliano della Rovere
>  wrote:
>> I'd like to modify the default search engine in the django admin
>> interface so that is can search metadata too like values depending on
>> sql COUNT() using google style prefixes in these cases.
>> Can somebody help me telling which class/method in the admin files is
>> responsible for the search engine so that I can extend 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-us...@googlegroups.com.
To unsubscribe from this group, 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: Caught ViewDoesNotExist while rendering: Could not import smsnotifications.views. Error was: No module named forms

2010-06-28 Thread Daniel Roseman
On Jun 27, 1:26 pm, Allen Machary  wrote:
> Hi All,
> i have a problem in import problem. in importing forms.py in views.py
> here are my files both located in smsnotifications app
>  -- smsnotifications/forms.py
> from django.forms import ModelForm
> from smsnotifications.models import SmsNotification
> class SmsNotificationForm(ModelForm):
>     class Meta:
>         model = SmsNotification
>         exclude = ('modified','created',)


Not sure why you needed to post 200 lines of commented-out code, but
never mind.

The thing you didn't post, which would have been useful, is the actual
traceback. My only guess is that there is a circular dependency
somewhere - are you importing smsnotifcations.forms inside
smsnotifcations.models, by any chance?
--
DR.

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



Re: error at first page of django tutorial

2010-06-28 Thread Kenneth Gonsalves
On Monday 28 June 2010 13:51:28 samie wrote:
> not able to fix it yet..
> 
> plz explain in detail..
> 

please go and learn the basics of python - as already suggested in this thread
-- 
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC

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



Re: error at first page of django tutorial

2010-06-28 Thread Daniel Roseman
On Jun 28, 9:21 am, samie  wrote:
> On Jun 28, 12:55 pm, Daniel Roseman  wrote:
>
> > On Jun 28, 8:49 am, samie  wrote:
>
> > > sir m getting problem in running my first django tutorial
> > > page..available athttp://docs.djangoproject.com/en/dev/intro/tutorial01/
>
> > > i had already tried it for 3 times earlier.. but not making it up to//
>
> > > i have installed django fromhttp://bitbucket.org/mirror/django-trunk
>
> > > that u earlier told me to do..
>
> > > and the problem occuring is
>
> > > ""
>
> > > IndentationError at /admin/
> > > unexpected indent (urls.py, line 5)
> > > Request Method: GET
> > > Request URL:    http://127.0.0.1:8000/admin/
> > > Django Version: 1.3 pre-alpha
> > > Exception Type: IndentationError
> > > Exception Value:
> > > unexpected indent (urls.py, line 5)
> > > Exception Location:     c:\python26\lib\site-packages\django\utils
> > > \importlib.py in import_module, line 35
> > > Python Executable:      c:\python26\python.exe
> > > Python Version: 2.6.5
> > > Python Path:    ['C:\\Python26\\mysite', 'C:\\Windows\\system32\
> > > \python26.zip', 'c:\\python26\\DLLs', 'c:\\python26\\lib', 'c:\
> > > \python26\\lib\\plat-win', 'c:\\python26\\lib\\lib-tk', 'c:\
> > > \python26', 'C:\\Users\\sony\\AppData\\Roaming\\Python\\Python26\\site-
> > > packages', 'c:\\python26\\lib\\site-packages']
> > > Server time:    Mon, 28 Jun 2010 13:08:54 +0530
>
> > > ""
>
> > > plz help
>
> > The problem is clearly stated, an indentation error on line 5 of
> > urls.py. If you don't understand why indentation is important, you
> > should do an introductory Python tutorial before trying the Django
> > one.
> > --
> > DR.
>
> not able to fix it yet..
>
> plz explain in detail..

No, honestly I'm not going to. First of all, I can't because you
haven't bothered to post the actual file that's giving the error.
Secondly, this is an absolutely fundamental part of Python programming
and if you won't look it up then you'll simply not be able to do
anything in Python or Django.

Seriously, go and read a Python tutorial. Here's one:
http://docs.python.org/tutorial/
--
DR.

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

2010-06-28 Thread euan.godd...@googlemail.com
I think that would be quite an undertaking as you would need to write
an expression parser and monkey around with the search code in admin.

If you succeed, I'd be interested to see the result.

Euan

On Jun 28, 8:36 am, Massimiliano della Rovere
 wrote:
> I'd like to modify the default search engine in the django admin
> interface so that is can search metadata too like values depending on
> sql COUNT() using google style prefixes in these cases.
> Can somebody help me telling which class/method in the admin files is
> responsible for the search engine so that I can extend 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-us...@googlegroups.com.
To unsubscribe from this group, 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: not able to install django development version

2010-06-28 Thread samie
done thnx..

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

2010-06-28 Thread samie
done thnx..

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, 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: Why is ModelAdmin to Model a 1-1 relationship?

2010-06-28 Thread euan.godd...@googlemail.com
That's a great solution. Much better than messing around with the
metaclass :)

On Jun 27, 5:47 am, Lee Hinde  wrote:
> On Fri, Jun 25, 2010 at 2:54 PM, patjenk  wrote:
> > In our application, we have a Model that has a boolean field named
> > "deleted". When the delete() method is called, we set the deleted
> > field to 1 and then save the model. We would like to create an admin
> > site where we can manage the deleted and non deleted instances
> > separately.
>
> > We could accomplish our goal by defining a queryset function for the
> > ModelAdmin that restricts the instances returned to deleted=0.
> > However, AFAIK this would eliminate the ability to undelete instances
> > via the admin. Another option is to allow all instances to be shown
> > and include delete as a value in the list_filter list for the admin
> > but that clutters up our UI and requires an extra click. It would be
> > nice if we could specify that the default admin view for this model
> > has a list_filter of deleted=0 but I don't think this is currently
> > possible.
>
> > I think a good solution would be to create two ModelAdmins. One to
> > display active instances and one to display deleted instances. With
> > this approach we could define a queryset function for each ModelAdmin
> > and when an instance is deleted it would automatically move to the
> > correct ModelAdmin. This is explicitly denied in django/contrib/admin/
> > sites.py. Simply removing this check does not solve our problem but
> > overwrites the first ModelAdmin for the model with the second via the
> > dictionary "_registered" in the AdminSite class. From my brief dive
> > into the admin site, there doesn't appear to be a real need for a one
> > to one relationship between ModelAdmins and Models. If you allowed
> > ModelAdmins to specify their own name I think it would be possible to
> > have more than one ModelAdmin for a Model. I am not a Django expert
> > but I don't see a reason that this scenario should be excluded.
>
> > Can anyone recommend a way to accomplish either of the approaches I
> > outlined above or propose a new approach that does not violate the
> > AdminSite rules? Also, if anyone knows why the ModelAdmin needs to
> > have a one to one relationship with Model please let me know.
>
> I recently clipped this for future reference. I believe it will help
> you do what you want:
>
> http://www.mahner.org/posts/separating-staff-and-user-accounts-in-dja...

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



Re: error at first page of django tutorial

2010-06-28 Thread samie


On Jun 28, 12:58 pm, Kenneth Gonsalves  wrote:
> On Monday 28 June 2010 13:19:45 samie wrote:
>
> > IndentationError at admin
> > unexpected indent (urls.py, line 5)
>
> go to line 5 of your urls.py file and fix the indentation
> --
> Regards
> Kenneth Gonsalves
> Senior Associate
> NRC-FOSS at AU-KBC




not able to fix it yet..

plz explain in detail..

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



Re: error at first page of django tutorial

2010-06-28 Thread samie


On Jun 28, 12:55 pm, Daniel Roseman  wrote:
> On Jun 28, 8:49 am, samie  wrote:
>
>
>
>
>
> > sir m getting problem in running my first django tutorial
> > page..available athttp://docs.djangoproject.com/en/dev/intro/tutorial01/
>
> > i had already tried it for 3 times earlier.. but not making it up to//
>
> > i have installed django fromhttp://bitbucket.org/mirror/django-trunk
>
> > that u earlier told me to do..
>
> > and the problem occuring is
>
> > ""
>
> > IndentationError at /admin/
> > unexpected indent (urls.py, line 5)
> > Request Method: GET
> > Request URL:    http://127.0.0.1:8000/admin/
> > Django Version: 1.3 pre-alpha
> > Exception Type: IndentationError
> > Exception Value:
> > unexpected indent (urls.py, line 5)
> > Exception Location:     c:\python26\lib\site-packages\django\utils
> > \importlib.py in import_module, line 35
> > Python Executable:      c:\python26\python.exe
> > Python Version: 2.6.5
> > Python Path:    ['C:\\Python26\\mysite', 'C:\\Windows\\system32\
> > \python26.zip', 'c:\\python26\\DLLs', 'c:\\python26\\lib', 'c:\
> > \python26\\lib\\plat-win', 'c:\\python26\\lib\\lib-tk', 'c:\
> > \python26', 'C:\\Users\\sony\\AppData\\Roaming\\Python\\Python26\\site-
> > packages', 'c:\\python26\\lib\\site-packages']
> > Server time:    Mon, 28 Jun 2010 13:08:54 +0530
>
> > ""
>
> > plz help
>
> The problem is clearly stated, an indentation error on line 5 of
> urls.py. If you don't understand why indentation is important, you
> should do an introductory Python tutorial before trying the Django
> one.
> --
> DR.


not able to fix it yet..

plz explain in detail..

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, 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: Caught ViewDoesNotExist while rendering: Could not import smsnotifications.views. Error was: No module named forms

2010-06-28 Thread Allen Machary
anyone with any idea on 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error at first page of django tutorial

2010-06-28 Thread Kenneth Gonsalves
On Monday 28 June 2010 13:19:45 samie wrote:
> IndentationError at admin
> unexpected indent (urls.py, line 5)
> 

go to line 5 of your urls.py file and fix the indentation
-- 
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC

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



Re: error at first page of django tutorial

2010-06-28 Thread Daniel Roseman
On Jun 28, 8:49 am, samie  wrote:
> sir m getting problem in running my first django tutorial
> page..available athttp://docs.djangoproject.com/en/dev/intro/tutorial01/
>
> i had already tried it for 3 times earlier.. but not making it up to//
>
> i have installed django fromhttp://bitbucket.org/mirror/django-trunk
>
> that u earlier told me to do..
>
> and the problem occuring is
>
> ""
>
> IndentationError at /admin/
> unexpected indent (urls.py, line 5)
> Request Method: GET
> Request URL:    http://127.0.0.1:8000/admin/
> Django Version: 1.3 pre-alpha
> Exception Type: IndentationError
> Exception Value:
> unexpected indent (urls.py, line 5)
> Exception Location:     c:\python26\lib\site-packages\django\utils
> \importlib.py in import_module, line 35
> Python Executable:      c:\python26\python.exe
> Python Version: 2.6.5
> Python Path:    ['C:\\Python26\\mysite', 'C:\\Windows\\system32\
> \python26.zip', 'c:\\python26\\DLLs', 'c:\\python26\\lib', 'c:\
> \python26\\lib\\plat-win', 'c:\\python26\\lib\\lib-tk', 'c:\
> \python26', 'C:\\Users\\sony\\AppData\\Roaming\\Python\\Python26\\site-
> packages', 'c:\\python26\\lib\\site-packages']
> Server time:    Mon, 28 Jun 2010 13:08:54 +0530
>
> ""
>
> plz help

The problem is clearly stated, an indentation error on line 5 of
urls.py. If you don't understand why indentation is important, you
should do an introductory Python tutorial before trying the Django
one.
--
DR.

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



error at first page of django tutorial

2010-06-28 Thread samie
sir m getting problem in running my first django tutorial
page..available at http://docs.djangoproject.com/en/dev/intro/tutorial01/

i had already tried it for 3 times earlier.. but not making it up to//

i have installed django from http://bitbucket.org/mirror/django-trunk

that u earlier told me to do..

and the problem occuring is


""

IndentationError at /admin/
unexpected indent (urls.py, line 5)
Request Method: GET
Request URL:http://127.0.0.1:8000/admin/
Django Version: 1.3 pre-alpha
Exception Type: IndentationError
Exception Value:
unexpected indent (urls.py, line 5)
Exception Location: c:\python26\lib\site-packages\django\utils
\importlib.py in import_module, line 35
Python Executable:  c:\python26\python.exe
Python Version: 2.6.5
Python Path:['C:\\Python26\\mysite', 'C:\\Windows\\system32\
\python26.zip', 'c:\\python26\\DLLs', 'c:\\python26\\lib', 'c:\
\python26\\lib\\plat-win', 'c:\\python26\\lib\\lib-tk', 'c:\
\python26', 'C:\\Users\\sony\\AppData\\Roaming\\Python\\Python26\\site-
packages', 'c:\\python26\\lib\\site-packages']
Server time:Mon, 28 Jun 2010 13:08:54 +0530


""

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



Admin Search Engline

2010-06-28 Thread Massimiliano della Rovere
I'd like to modify the default search engine in the django admin
interface so that is can search metadata too like values depending on
sql COUNT() using google style prefixes in these cases.
Can somebody help me telling which class/method in the admin files is
responsible for the search engine so that I can extend 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-us...@googlegroups.com.
To unsubscribe from this group, 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: Djangoprojects tutorial

2010-06-28 Thread Sithembewena Lloyd Dube
Hi there,

Please paste the code in your settings.py file's INSTALLED_APPS, and your
Poll code from models.py.

On Mon, Jun 28, 2010 at 8:50 AM, Eduan  wrote:

> Hi I am new at Django and was told to start at
> http://docs.djangoproject.com/en/dev/intro/tutorial01/ this website
> gives you a easy tutorial for beginners. I was following it exatly as
> it says and I got an error. I started over and got the same error
> again.
> I was running this command:
> python manage.py sql polls
>
> and I immediately got this error back:
> Error: No module named mysite.polls
>
> Please any help would be appreciated. I am fairly sure that it can't
> be something big because I have not done much yet.
>
> Eduan
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, 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,
Sithembewena Lloyd Dube
http://www.lloyddube.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Djangoprojects tutorial

2010-06-28 Thread Eduan
Hi I am new at Django and was told to start at
http://docs.djangoproject.com/en/dev/intro/tutorial01/ this website
gives you a easy tutorial for beginners. I was following it exatly as
it says and I got an error. I started over and got the same error
again.
I was running this command:
python manage.py sql polls

and I immediately got this error back:
Error: No module named mysite.polls

Please any help would be appreciated. I am fairly sure that it can't
be something big because I have not done much yet.

Eduan

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