Friday, February 1, 2013

How is fatcow for django hosting?

Hello,

Anyone use them?
I am trying to compare them to Bluehost.com

Thanks

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

Re: Polls tutorial receive object not object representation

On Jan 27, 2013 10:58 PM, "Sayth Renshaw" <flebber.crue@gmail.com> wrote:
>
> Now the only thing is that when I call p.choice_set.all() I don't get the representation 'The sky' or 'Just Hacking again' . I receive choice object itself. Is this normal?

That happens because you seem to hsve missed or decided to skip the instructions located right above the interactive section you are at:

The one about adding __unicode__ methods to the models and saving the models.py file.

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

MySQL, manage.py and nvarchar

Hello,

I'm just starting with Django and am trying to create a db table with nvarchar fields as opposed to varchar.

I'm using MySQL and creating objects of type models.CharField() within my classes.

Any ideas?

Cheers,

Patrick

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

Can't perform data migrations using django 1.5 Custom user class

I have many applications with historic south initial migrations, which i wanted to convert to django 1.5 applicable. So i swapped out all orm['auth.User'] relation with custom ones, but when i try to run those migrations i get following error:

Error in migration: django_notify:0001_initial
KeyError: "The model 'customuser' from the app 'profiles' is not available in this migration."

The migration in question is this:
http://bpaste.net/show/2CwaYrlNifNTd5gcHUfK/

My custom User class is:
class CustomUser(AbstractUser):
    image = models.ImageField(_('Image Field'), upload_to='user_images')


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

Can't convert app to south due to django 1.5 custom User model.

I have a custom app in my project named 'profiles' which contains a custom User model. Here is the declaration of the same:

class CustomUser(AbstractUser):
    image = models.ImageField(_('Image Field'), upload_to='user_images')

I have pointed this in my settings module, AUTH_USER_MODEL = 'profiles.CustomUser'

and in my settings i have 2 installed apps only, 1. South and 2. profiles.

when i do syncdb, everything seems to work fine, but when I django-admin.py convert_to_south profiles, it gives me following error:
Creating migrations directory at '/Users/tejinder/Projects/basidia/apps/profiles/migrations'...
Creating __init__.py in '/Users/tejinder/Projects/basidia/apps/profiles/migrations'...
 + Added model profiles.CustomUser
 + Added M2M table for groups on profiles.CustomUser
 + Added M2M table for user_permissions on profiles.CustomUser
Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate profiles
CommandError: One or more models did not validate:
auth.user: Model has been swapped out for 'profiles.CustomUser' which has not been installed or is abstract.

What could have been gone wrong? Thanks in advance.

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

select_related() - suddenly to result

Hi,

I have the following query:

Buch = Buchung.objects.filter(Produkt = int(POSTvalues['Produkt']))

Later I'm using stuff like:

Buch.Produkt.Bestell_Nr

To speed things up i wan't to use select_related() on the query but no mather where I add it if I add it i get 0 entries as a result where without select_related() I do get entries.

I've tried this:

Buch = Buchung.objects.filter(Produkt = int(POSTvalues['Produkt'])).select_related()

and

Buch = Buchung.objects.select_related().filter(Produkt = int(POSTvalues['Produkt']))

Any ideas why the results are wrong if I use select_related()

cheers


. . . . . . . . . . . . . . . . . . . . . . . . . .
Ing. Patrick Szabo
Developer
LexisNexis
A-1030 Wien, Marxergasse 25

mailto:Patrick.Szabo@lexisnexis.at
Tel.: +43 1 53452 1573
Fax.: +43 1 534 52 146

. . . . . . . . . . . . . . . . . . . . . . . . . .

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

Re: initial argument in forms not working for me

On Mon, Jan 28, 2013 at 5:35 AM, Nikhil Verma <varma.nikhil22@gmail.com> wrote:
> Hi
>
> I am using django 1.4.3 and have a field in form
>
>
> PROFILE_TYPE = (
> ('public', 'Public'),
> ('private', 'Private'),
> )
> profile_type = forms.CharField(max_length=10, widget=RadioSelect
> (choices=PROFILE_TYPE),
> initial='Public',
> required=False
> )
>
> I want that when i open this form the radio button with choice public should
> be pre selected.
> Can anybody explain what mistake you are doing ?
>
> Thanks

You've specified the initial value as 'Public', which does not match
either of the allowed choices, 'public' and 'private'.

Cheers

Tom

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