Monday, October 31, 2011

Disk I/O Error

I'm getting a DatabaseError, looking like this:

Django Version: 1.3
Exception Type: DatabaseError
Exception Value: disk I/O error
Exception Location: /usr/local/lib/python2.6/dist-packages/django/db/
backends/sqlite3/base.py in execute, line 234

whenever I try to read or write to any of the databases associated
with any of the websites on one of our servers. The fact that all
these websites work locally, but not in their live versions seems to
suggest to me that something has gone wrong on the server, rather than
with django, but I thought I'd better ask and see if any one has had
any similar issues. I'm running python 2.6.6, django 1.3 and they're
on a Linux server.

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

Re: new formwizard - how to pass data between forms

Awesome! Let me know how it works out for you. I'll probably be giving it a try shortly as well. Thanks for sharing the good information.

On Mon, Oct 31, 2011 at 6:43 PM, andreas <dalebc@gmail.com> wrote:
Hey Kurtis,

thanks for your answer.

I think hidden fields were used in the old implementation.
At least the release notes for 1.4 say:
"It features a pluggable storage API and doesn't require the wizard to
pass around hidden fields for every previous step."
But checking the example apps (https://github.com/stephrdev/django-
formwizard/blob/master/test_project/testapp2/views.py#L20
) i found
what i was looking for:
get_cleaned_data_for_step()

It does exactly what i need :-)

On 31 Okt., 03:07, Kurtis Mullins <kurtis.mull...@gmail.com> wrote:
> I haven't read that particular back ports docs but when I looked at the dev docs for the new form wizard a little while back, I believe that it stores all previous data as hidden fields throughout the process. So I would think form.cleaned_data should contain everything. Hopefully that helps a little :)
>
> Sent from my iPad
>
> On Oct 29, 2011, at 11:19 AM, andreas <dal...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi all,
>
> > i am using the backport of django's new formwizard (https://github.com/
> > stephrdev/django-formwizard).
> > and i am looking for the recommended way to pass data between the
> > different forms/steps.
>
> > Basically i am using the formwizard to process a series of forms that
> > let the user (further) specify filter options from step to step.
> > For example in the first step you would choose from a list of
> > countries, the next form would give you the states form these
> > countries and the final result of the wizard (done()) renders a list
> > of the major cities in these states.
>
> > If i use get_form_kwargs (https://docs.djangoproject.com/en/dev/ref/
> > contrib/formtools/form-wizard/
> > #django.contrib.formtools.wizard.views.WizardView.get_form_kwargs) i
> > can access the data from the previous step via self.request.POST and
> > pass   the selected choices to the form constructor of the next form
> > where i then filter the choices of the relevant field.
>
> > But is it also possible to access the selected data fron step 1 in
> > step4?
> > Something like get_all_cleaned_data() but just for the processed
> > steps?
>
> > --
> > You received this message because you are subscribed to the Google Groups "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

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

Re: Can't add superuser

On Nov 1, 4:43 am, Karen Tracey <kmtra...@gmail.com> wrote:
> On Mon, Oct 31, 2011 at 8:43 AM, rihad <ri...@mail.ru> wrote:
> > Hi, I'm unable to add superuser. Running latest development trunk of
> > Django, & Python 2.7
>
> This has been reported:https://code.djangoproject.com/ticket/16017
>
> One way to fix it would be to get a locale properly set on your machine.

Thanks. I just set LANG=en_US.UTF-8 (from empty), dropped the
auth_user & django_site tables for them to be recreated, ran "manage
syncdb", and now everything works. Apparently it's a new quirk of
Django, earlier releases didn't care if LANG was set.

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

Re: Why are my two django objects of the same type behaving differently?

Somebody answered this
http://stackoverflow.com/questions/7954474/why-are-my-two-django-objects-of-the-same-type-behaving-differently

...
>>> s = '%build%'
>>> content_query = content_class.objects.raw("Select * from pms_building where name like %s",[s])
>>> type(content_query)
<Building: Building A>

Works well.

Thanks

On Oct 31, 5:30 pm, Gath <pgath...@gmail.com> wrote:
> Help!
>
> I have two objects that i have created using different techniques in
> django;
>
> >>> from django.contrib.contenttypes.models import ContentType
> >>> from myproject.models import Building
>
> Method A
>
> >>> content_type = ContentType.objects.get(app_label='myproject', model='Building')
> >>> content_class = content_type.model_class()
> >>> content_query = content_class.objects.raw("Select * from pms_building where name like '%build%' ")
> >>> type(content_query)
>
> <class 'django.db.models.query.RawQuerySet'>>>> content_query[0]
>
> # error ....
> # Attribute: 'str' object has no attribute 'items'
>
> Method B
>
> >>> bld = Building.objects.raw("Select * from pms_building where name like '%build%' ")
> >>> type(bld)
>
> <class 'django.db.models.query.RawQuerySet'>
>
> >>>bld[0]
>
> <Building: Building A>
>
> My question is why are the two objects of the same type behaving
> differently?
>
> Gath

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

Re: Django - tutorial part 2 problem - Permission denied when attempting to save file

It looks like you don't have write permissions to the "base_site.html"
file, or if the file doesn't exist, than you likely don't have proper
permissions for the enclosing folder. What is the full path of the file
you're attempting to edit?

On 10/31/2011 6:30 PM, BillB1951 wrote:
> Got this error
> Ran into this as part of the Django tutorial (part 2) very close to
> the bottom .... an attempt to change the page header/title.
>
>
> "There was an error attempting to save 'base_site.html':Permission
> denied"
>
> when trying to save the file below (copied from django source code)
>
>
>
> {% extends "admin/base.html" %}
> {% load i18n %}
>
> {% block title %}{{ title }} | {% trans 'Django site admin' %}{%
> endblock %}
>
> {% block branding %}
> <h1 id="site-name">{% trans 'Django administration' %}</h1>
> {% endblock %}
>
> {% block nav-global %}{% endblock %}
>
>
> any thoughts?
>

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

Re: I can't activate the admin site

On Mon, 2011-10-31 at 17:31 +0200, Nick Apostolakis wrote:
> On 31/10/2011 02:12 μμ, kenneth gonsalves wrote:
> >
> > but the indentation error seems to be in the django source code?
> > Normally one does not fiddle with that.
> >
>
> no I wouldn't expect the indentation problem to be located in django
> code.
> unless you are using an unstable version or something....
>
>

the source might have got corrupted. A reinstall may solve the problem.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Django - tutorial part 2 problem - Permission denied when attempting to save file

Got this error
Ran into this as part of the Django tutorial (part 2) very close to
the bottom .... an attempt to change the page header/title.


"There was an error attempting to save 'base_site.html':Permission
denied"

when trying to save the file below (copied from django source code)

{% extends "admin/base.html" %}
{% load i18n %}

{% block title %}{{ title }} | {% trans 'Django site admin' %}{%
endblock %}

{% block branding %}
<h1 id="site-name">{% trans 'Django administration' %}</h1>
{% endblock %}

{% block nav-global %}{% endblock %}


any thoughts?

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