Wednesday, June 1, 2011

Re: DeprecationWarning: A Field class whose get_db_prep_value method hasn't been updated to take `connection` and `prepared` arguments

Hi,

thanks for the quick response. Well, I am not seeing it, when I create
a complete new project.

regards, tom

On 1 Jun., 16:07, Brendan Smith <bren...@nationalpriorities.org>
wrote:
> i've also got this warning on a bone stock django install + mysql backend.
> I've started to just ignore it for now
>
>
>
>
>
> On Wed, Jun 1, 2011 at 9:08 AM, tom <thomas.st...@gmail.com> wrote:
> > Hello,
>
> > since I have upgraded to django 1.3 i see following errors:
> > DeprecationWarning: A Field class whose get_db_prep_value method
> > hasn't been updated to take `connection` and `prepared` arguments
>
> > There are following packges installed:
>
> > INSTALLED_APPS = (
> >    'debug_toolbar', # OK
> >    'django.contrib.auth',
> >    'django.contrib.contenttypes',
> >    'django.contrib.sessions',
> >    'django.contrib.sites',
> >    'django.contrib.admin',
> >    'django.contrib.admindocs',
> >    'django.contrib.flatpages',
> >    'django.contrib.markup',
> >    'django.contrib.messages',
> >    'django.contrib.humanize',
> >    'django.contrib.redirects',
> >    'payments.moneybookers', # OK
> >    'djcelery', # OK
> >    'compress', # OK
> >    'johnny', # OK
> >    'tagging', # OK
> >    'registration', # OK
> >    'django_extensions', # OK
> >    'profiles', # OK
> > )
>
> > I already have updated the 3rd party modules to the latest version and
> > I also have tried to deactivate module by module. But the warning does
> > not go away.
>
> > Any hints?
>
> > Many thanks for your help!
>
> > regards, Tom
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Brendan Smith, IT Specialist
> National Priorities Projecthttp://www.nationalpriorities.orghttp://www.costofwar.comhttp://www.facebook.com/nationalpriorities
> 413 584 9556

--
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: Contact us form

thank you that was helpful the settings were not correct

django form is great

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/RWtBR3JNZ21DaHdK.
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: DeprecationWarning: A Field class whose get_db_prep_value method hasn't been updated to take `connection` and `prepared` arguments

i've also got this warning on a bone stock django install + mysql backend.   I've started to just ignore it for now

On Wed, Jun 1, 2011 at 9:08 AM, tom <thomas.stagl@gmail.com> wrote:
Hello,

since I have upgraded to django 1.3 i see following errors:
DeprecationWarning: A Field class whose get_db_prep_value method
hasn't been updated to take `connection` and `prepared` arguments

There are following packges installed:

INSTALLED_APPS = (
   'debug_toolbar', # OK
   'django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.sites',
   'django.contrib.admin',
   'django.contrib.admindocs',
   'django.contrib.flatpages',
   'django.contrib.markup',
   'django.contrib.messages',
   'django.contrib.humanize',
   'django.contrib.redirects',
   'payments.moneybookers', # OK
   'djcelery', # OK
   'compress', # OK
   'johnny', # OK
   'tagging', # OK
   'registration', # OK
   'django_extensions', # OK
   'profiles', # OK
)

I already have updated the 3rd party modules to the latest version and
I also have tried to deactivate module by module. But the warning does
not go away.

Any hints?

Many thanks for your help!

regards, Tom

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




--
Brendan Smith, IT Specialist
National Priorities Project
http://www.nationalpriorities.org
http://www.costofwar.com
http://www.facebook.com/nationalpriorities
413 584 9556

--
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: Chained forms

On Wed, Jun 1, 2011 at 9:52 AM, bruno desthuilliers
<bruno.desthuilliers@gmail.com> wrote:
> On May 31, 6:55 pm, Marc Aymerich <glicer...@gmail.com> wrote:
>> Hi!,
>> I'm writing an admin action.
>> This action needs to collect some information before execute the "final
>> task".
>> In order to collect this information the user should fill 3 consecutive
>> forms, (once they submitted one, another is rendered).
>>
>> My question is,
>> How can I store the form fields state submitted on each form, and retrieve
>> this fields states on the final form, before execute the 'final task'?
>
>
> This is a well-known problem, with 2 well-known solutions: 1/ store
> the state in hidden fields or 2/ use sessions.
>
> The form-wizard contrib app mentionned by DrBloodmoney uses the first
> approach, which makes it "more general" since you can use it without
> having to resort to sessions. OTHO, I didn't find it quite as easy to
> use and flexible as I would have liked, specially when I had to fork
> it to give users the possibility to navigate backward. You should
> nonetheless give it a try first and see if it works for you. If it
> doesn't, you may want to roll your own session-based solution.
>
> HTH
>


Thanks DrBloodmoney and bruno,
I try to use wizard forms in order to accomplish this. But I have some
problems:
I don't know why but when I execute the action, it jumps directly to
step 2 and when I submit this step 2, it returns to the admin
changelist, ignoring the last step. Also the wizard seems to ignore
the initial data.

Anyone see something wrong in my code?
it is based on this snippet:
http://ten.ynottony.net/2011/01/using-django-formwizard-in-a-view/

class OrderAdmin(admin.ModelAdmin):
actions = ['bill_orders',]

def bill_orders(modeladmin, request, queryset):
from datetime import datetime
from django.template import RequestContext
initial = {0: { 'bill_point': datetime.now(),
'fixed_point': True,
},}
form = ContactWizard([b1, b2, b3], initial=initial)
return form(context=RequestContext(request),request=request)


from django import forms
from django.shortcuts import render_to_response
from django.contrib.formtools.wizard import FormWizard

class b1(forms.Form):
bill_point = forms.DateField(required=False)
fixed_point = forms.BooleanField(required=False)
force_next = forms.BooleanField(required=False)
create_new_open = forms.BooleanField(required=False)

class b2(forms.Form):
BILL_OR_PRICING_CHOICES = (
(True, 'Bill this ordres too'),
(False, 'Only use for Pricing'),)
effect = forms.ChoiceField(choices=BILL_OR_PRICING_CHOICES, required=False)

class b3(forms.Form):
bill_point2 = forms.DateField(required=False)

class ContactWizard(FormWizard):
def done(self, request, form_list):
return render_to_response('done.html', {
'form_data': [form.cleaned_data for form in form_list],})

def get_template(self, step):
return ['billing/wizard_%s.html' % step, 'billing/wizard.html']

Thanks!
--
Marc

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

Freelance Python/Django Developers Required‏

Hi Everyone,

I am looking for freelance Python/Django developers for a USA based company to work from home.

Please contact at farhan_ahmed23@odesk.com or fa_malik23@yahoo.com for more information.

Thanks,

Farhan
http://pk.linkedin.com/pub/farhan-malik/34/361/221

Re: django-profiles and get_absolute_url

Patch was submitted here:
https://bitbucket.org/ubernostrum/django-profiles/issue/10/user-names-cant-have-periods-etc#comment-502428

On May 31, 5:17 pm, Andrew Sledge <andrew.j.sle...@gmail.com> wrote:
> Thank you Matias.
>
> Your syntax was a little off, but you did solve it. Here is the
> correct syntax:
>
> import profiles
> ...
> ...
> ...
> url(r'^profiles/(?P<username>[\w\.]+)/$',
> 'profiles.views.profile_detail', name='profiles_profile_detail'),
>
> I will submit a patch to django-profiles to support the characters
> "@/./+/-/_".
>
> On May 31, 5:00 pm, Matías Aguirre <matiasagui...@gmail.com> wrote:
>
>
>
>
>
>
>
> > This is the value for such url definition:
>
> >     url(r'^(?P<username>\w+)/$', views.profile_detail, name='profiles_profile_detail'),
>
> > the rule uses \w+ which doesn't match the dot character. Example:
>
> >     >>> import re
> >     >>> r = re.compile('(\w+)')
> >     >>> r.match('name.1').groups()
> >     ('name',)
> >     >>> r.match('.')
> >     >>>
>
> > So, basically, django-profiles doesn't support usernames with dots characters,
> > you might need to override such URL.
>
> >     url(r'^profiles/(?P<username>[\w\.]+)/$', views.profile_details,
> >         name='profiles_profile_detail'),
> >     url(r'^profiles/', include('profiles.urls')),
>
> > Makes sense?
>
> > Matías
>
> > Excerpts from Andrew Sledge's message of Tue May 31 17:51:15 -0300 2011:
>
> > > Don't think that has anything to do with it, but here goes...
>
> > > url(r'^profiles/', include('profiles.urls')),
>
> > > The remaining url config is provided by django-profiles.
>
> > > On May 31, 4:46 pm, Matías Aguirre <matiasagui...@gmail.com> wrote:
> > > > Hi,
>
> > > > Could you share the URL rule for profiles_profile_detail?
>
> > > > Matías
>
> > > > Excerpts from Andrew Sledge's message of Tue May 31 17:37:20 -0300 2011:
>
> > > > > Hi All,
>
> > > > > I am having trouble getting an absolute URL using the django-profiles
> > > > > module with usernames that have periods in them (for instance "/
> > > > > profiles/user.1").
>
> > > > > Here is my profile class:
>
> > > > > class UserProfile(models.Model):
> > > > >   user = models.ForeignKey(User, unique=True)
> > > > >   web_site = models.URLField(blank=True, null=True,
> > > > > verify_exists=False)
>
> > > > >   @models.permalink
> > > > >   def get_absolute_url(self):
> > > > >     return ('profiles_profile_detail', (), {'username':
> > > > > unicode(self.user.username)})
>
> > > > > If the user name does not have a period in it, it returns a desirable
> > > > > URL (for instance "/profiles/user1" and "/profiles/user_1" work).
>
> > > > > I've tried forcing to unicode, to str, and leaving blank. I've even
> > > > > forced UTF coding in the database using PRAGMA encoding="UTF-8";
>
> > > > > Running out of ideas here...any thoughts?
>
> > > > --
> > > > Matías Aguirre <matiasagui...@gmail.com>
>
> > --
> > Matías Aguirre <matiasagui...@gmail.com>

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

DeprecationWarning: A Field class whose get_db_prep_value method hasn't been updated to take `connection` and `prepared` arguments

Hello,

since I have upgraded to django 1.3 i see following errors:
DeprecationWarning: A Field class whose get_db_prep_value method
hasn't been updated to take `connection` and `prepared` arguments

There are following packges installed:

INSTALLED_APPS = (
'debug_toolbar', # OK
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.flatpages',
'django.contrib.markup',
'django.contrib.messages',
'django.contrib.humanize',
'django.contrib.redirects',
'payments.moneybookers', # OK
'djcelery', # OK
'compress', # OK
'johnny', # OK
'tagging', # OK
'registration', # OK
'django_extensions', # OK
'profiles', # OK
)

I already have updated the 3rd party modules to the latest version and
I also have tried to deactivate module by module. But the warning does
not go away.

Any hints?

Many thanks for your help!

regards, Tom

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