Re: Django driving me nuts

2013-09-01 Thread Gerd Koetje
thanks will use the irc

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Why does the save form order make any difrance?

2013-09-01 Thread Gerd Koetje
so like this?
Can u tell me why this have to be this way?

form = ProfielenForm(request.POST, instance=request.user.profile)
if form.is_valid():
form.save()

form2 = ProfielenForm2(request.POST, instance=request.user.profile)
if form2.is_valid():
form2.save()

form3 = ProfielenForm3(request.POST, instance=request.user.profile)
if form3.is_valid():
form3.save()

form4 = ProfielenForm4(request.POST, instance=request.user.profile)
if form4.is_valid():
form4.save()

form5 = ProfielenForm5(request.POST, instance=request.user.profile)
if form5.is_valid():
form5.save()

form6 = ProfielenForm6(request.POST, instance=request.user.profile)
if form6.is_valid():
form6.save()

form7 = ProfielenForm7(request.POST, instance=request.user.profile)
if form7.is_valid():
form7.save()

form8 = ProfielenForm8(request.POST, instance=request.user.profile)
if form8.is_valid():
form8.save()

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Why does the save form order make any difrance?

2013-08-31 Thread Gerd Koetje
anyone?

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Why does the save form order make any difrance?

2013-08-31 Thread Gerd Koetje
if u need to see any other code let me know

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Why does the save form order make any difrance?

2013-08-31 Thread Gerd Koetje
Hi,


Why does this save sometimes not save all forms
If i set form8 at the top it doesnt save form 8
When i set it at the bottom it does save form 8, but not any others

without the form8 all works


if request.POST:

form = ProfielenForm(request.POST, instance=request.user.profile)
form2 = ProfielenForm2(request.POST, instance=request.user.profile)
form3 = ProfielenForm3(request.POST, instance=request.user.profile)
form4 = ProfielenForm4(request.POST, instance=request.user.profile)
form5 = ProfielenForm5(request.POST, instance=request.user.profile)
form6 = ProfielenForm6(request.POST, instance=request.user.profile)
form7 = ProfielenForm7(request.POST, instance=request.user.profile)
form8 = ProfielenForm8(request.POST, instance=request.user.profile)



if form7.is_valid():
form7.save()

if form6.is_valid():
form6.save()

if form5.is_valid():
form5.save()

if form4.is_valid():
form4.save()

if form3.is_valid():
form3.save()

if form2.is_valid():
form2.save()

if form.is_valid():
form.save()

if form8.is_valid():
form8.save()

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Gerd Koetje
i gues im learning it the hard way atm.
Just wanna convert my php application to python, but its hard when i miss 
out on some basic stuff. giving me headpains haha :D

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Gerd Koetje
yeah i really should do more python learning.
and i will do :D

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Gerd Koetje
stupid me, its almost like php

 if testdata == False:
>

fixed it



Thanks alot for your help all.
Appreciated 

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Gerd Koetje
think i fixed the true/false thing, return True was on the wrong indent

it still doesnt trow the error , so i gues my if testdata us False:  is 
wrong?

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Gerd Koetje
it somehow keeps returning True on everything

accepted = string.letters + string.digits
max_numbers = 4


def test(word):
numbers = 0
for c in word:
if c.isdigit():
numbers += 1
if not c in accepted or numbers > max_numbers:
   return False
return True

# profielnaam
class ProfielenForm(forms.ModelForm):


def clean_profielnaam(self):

logger.debug('>>>FORMS< %s', accepted)


data = self.cleaned_data['profielnaam']
testdata = test(data)
logger.debug('>>>FORMS<< >DATA< %s', 
testdata)

if testdata is "False":
raise forms.ValidationError("Je mag alleen tekst en cijfers 
gebruiken en geen spaties")

return data

class Meta:
model = Profielen
fields = ('profielnaam',)

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Gerd Koetje
like this?


import string
accepted = string.letters + string.digits
max_numbers = 4

def test(word):
numbers = 0
for c in word:
if c.isdigit():
numbers += 1
if not c in accepted or numbers > max_numbers:
   return False
return True

# Create profiel

# profielnaam
class ProfielenForm(forms.ModelForm):




def clean_profielnaam(self):
data = self.cleaned_data['profielnaam']
if test(data) is False:
raise forms.ValidationError("Je mag alleen tekst en cijfers 
gebruiken en geen spaties")

return data

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Gerd Koetje
im working with this code in my forms.py btw.
I see some guys do it in models.py instead

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Gerd Koetje
to explain myself a bit more:

gerd12 = should be valid
gerd1234   = should be valid
gerd 1234 = should not be valid
%$$%%#$ = should not be valid
gerd123456 - should not be valid

etc etc

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Gerd Koetje

>
> same result still can input spaces weird chars and more then 4 numbers
>

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Gerd Koetje
that still allows space,weird chars and more then 4 numbers

input: 
dfdfdf565665&^^^ 
got saved



def clean_profielnaam(self):
data = self.cleaned_data['profielnaam']
if not re.match(r'^[a-zA-Z0-9]{1,4}', data):
raise forms.ValidationError("Je mag alleen tekst en cijfers 
gebruiken en geen spaties")

return data

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Gerd Koetje
Hi all,

How do i valididate for this?

- numbers and text only , no spaces
- max 4 number




def clean_profielnaam(self):
data = self.cleaned_data['profielnaam']
if not re.match(r'^[a-z][0-9]+', data):
raise forms.ValidationError("Je mag alleen tekst en cijfers 
gebruiken en geen spaties")

return data

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: list(form) makes my form not safe anymore

2013-08-31 Thread Gerd Koetje
When i use it with list(form)
It shows the form normally, but when i save the form, nothing gets saved, 
no errors also.

im trying a difrant approach now:

Im makking multiple forms on forms.py   each with the fields i want in it.

Code so far, seems to work only when i do for before form2 it wont save 
form, when i di form2 and then form  then it works like a charm


*Views.py*

@login_required
def create(request):

if request.POST:
logger.debug('>>>POST POST POST<<<')
form = ProfielenForm(request.POST, instance=request.user.profile)
form2 = ProfielenForm2(request.POST, instance=request.user.profile)

if form2.is_valid():
form2.save()

if form.is_valid():
form.save()



return HttpResponseRedirect('/profielen/all')
else:

user = request.user
profile = user.profile
form = ProfielenForm(instance=profile)
form2 = ProfielenForm2(instance=profile)


args = {}
args.update(csrf(request))
args['context_instance'] = RequestContext(request)
args['form'] = form
args['form2'] = form2


return render(request, 'create_profiel.html', args)





*create_profiel.html*

{% extends "base.html" %}

{% block sidebar %}


Cancel

{% endblock %}

{% block content %}


{% csrf_token %}


Kies een profielnaam



{{ form.as_ul }}











anders



{{ form2.as_ul }}


















{% endblock %}

*
*
*
*
*
*
*
*
*forms.py*
*
*
class ProfielenForm(forms.ModelForm):

class Meta:
model = Profielen
fields = ('profielnaam',)



class ProfielenForm2(forms.ModelForm):


#kleurogen = 
forms.ModelMultipleChoiceField(queryset=Keuzes.objects.filter(groep_id='kleurogen'))
#lengtehaar = 
forms.ModelMultipleChoiceField(queryset=Keuzes.objects.filter(groep_id__name='lengtehaar'))

burgelijkestaat = 
forms.ModelMultipleChoiceField(queryset=Burgelijkestaat_data.objects, 
widget=forms.CheckboxSelectMultiple(), required=False)

class Meta:
model = Profielen
fields = ('burgelijkestaat',)

class Media:

css = {
'all': 'checkbox.css',
}

def __init__(self, *args, **kwargs):
super(ProfielenForm2, self).__init__(*args, **kwargs)
self.fields['burgelijkestaat'].widget.attrs['class'] = 'checkboxen'









-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: list(form) makes my form not safe anymore

2013-08-31 Thread Gerd Koetje
thats not what i trying todo

Im seperating the entire form in difrant sections of the layout

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: list(form) makes my form not safe anymore

2013-08-31 Thread Gerd Koetje
atleast not with this code to seperate it

{% for field in form|slice:"1:8" %}

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: list(form) makes my form not safe anymore

2013-08-31 Thread Gerd Koetje
without the list(form) part that doesnt seem to work

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django driving me nuts

2013-08-31 Thread Gerd Koetje
Hope anyone can tell me why it doesnt save th eform anymore when i use 
list(form)

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django driving me nuts

2013-08-31 Thread Gerd Koetje
https://groups.google.com/forum/#!topic/django-users/fgGyE_UPWq0

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Django driving me nuts

2013-08-31 Thread Gerd Koetje
Why is it so hard to get as a former php programmer.

I'm trying to cut my form in difrant sections , what seemed to work when i 
use list(forms)
But then my forms dont save anymore

anyone willing to help me over this part?



-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: I really about to give up Django

2013-08-31 Thread Gerd Koetje
if u want someone else to understand use english

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: list(form) makes my form not safe anymore

2013-08-30 Thread Gerd Koetje
anyone?

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: list(form) makes my form not safe anymore

2013-08-30 Thread Gerd Koetje
In my view i do this form, and it only works when i use list



{% csrf_token %}
{{ form.media }}


Kies een profielnaam



{% for field in form|slice:":1" %}

{{ field.label_tag }}
{{ field }}
{% if field.errors %}{{ field.errors }}{% endif %}

{% endfor %}










Profielgegevens



{% for field in form|slice:"1:8" %}

{{ field.label_tag }}
{{ field }}

{% endfor %}









Persoonsgegevens



{% for field in form|slice:"8:18" %}

{{ field.label_tag }}
{{ field }}

{% endfor %}












Burgelijkestaat



{% for field in form|slice:"18:19" %}

{{ field.label_tag }}
{{ field }}

{% endfor %}












Opleidingsniveau



{% for field in form|slice:"19:20" %}

{{ field.label_tag }}
{{ field }}

{% endfor %}












Levensstijl



{% for field in form|slice:"20:21" %}

{{ field.label_tag }}
{{ field }}

{% endfor %}












Uiterlijkekenmerken



{% for field in form|slice:"21:22" %}

{{ field.label_tag }}
{{ field }}

{% endfor %}












Belangstellingvoor



{% for field in form|slice:"22:23" %}

{{ field.label_tag }}
{{ field }}

{% endfor %}












Sexvoorkeuren



{% for field in form|slice:"23:24" %}

{{ field.label_tag }}
{{ field }}

{% endfor %}










-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


list(form) makes my form not safe anymore

2013-08-30 Thread Gerd Koetje

Why does list(form) make my form not safe anymore?





@login_required
def create(request):

if request.POST:
logger.debug('>>>POST POST POST<<<')
form = ProfielenForm(request.POST, instance=request.user.profile)
if form.is_valid():
form.save()

return HttpResponseRedirect('/profielen/all')
else:

user = request.user
profile = user.profile
form = ProfielenForm(instance=profile)

args = {}
args.update(csrf(request))
args['context_instance'] = RequestContext(request)
args['form'] = list(form)

return render(request, 'create_profiel.html', args)


-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Skip form field when its filled in

2013-08-30 Thread Gerd Koetje
Hi all,


I got a form filed called : profilename
When this field is filled in i want to skip if in my form, but i want to 
shot it when its empty.

any easy way todo this?

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Skip form field when its filled in

2013-08-30 Thread Gerd Koetje
thats doesnt work like i tought do :D

class ProfielenForm(forms.ModelForm):

#kleurogen = 
forms.ModelMultipleChoiceField(queryset=Keuzes.objects.filter(groep_id='kleurogen'))
#lengtehaar = 
forms.ModelMultipleChoiceField(queryset=Keuzes.objects.filter(groep_id__name='lengtehaar'))


class Meta:
model = Profielen
exclude = ('user',)

def get_form(self, request, obj=None, **kwargs):
kwargs['exclude'] = ['profielnaam',]

return super(ProfielenForm, self).get_form(request, obj, **kwargs)

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Skip form field when its filled in

2013-08-30 Thread Gerd Koetje
proberly something like this?


def get_form(self, request, obj=None, **kwargs):
if request.user.is_superuser:
kwargs['exclude'] = ['foo',]

return super(CategoryModelAdmin, self).get_form(request, obj, 
**kwargs)

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django translation error

2013-08-28 Thread Gerd Koetje
i solved it. my mac created some weird ghost files that conflicted with it

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django translation error

2013-08-28 Thread Gerd Koetje
now i got passed that and i get this one


(django-env)[root@python pythondating]# django-admin.py makemessages -l nl
processing language nl
DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0xb0 in position 
37: invalid start byte. You passed in '\x00\x05\x16\x07\x00\x02\x00\x00Mac 
OS X   
 
\x00\x02\x00\x00\x00\t\x00\x00\x002\x00\x00\x0e\xb0\x00\x00\x00\x02\x00\x00\x0e\xe2\x00\x00\x01\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00ATTR\x00\x00]U\x00\x00\x0e\xe2\x00\x00\x00\x98\x00\x00\x00C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x98\x00\x00\x00C\x00\x00\x15com.apple.quarantine\x01;5207e95d;Google\\x20Chrome;8AFDA5C2-53DE-4409-A9A0-A055DA351D0C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x

django translation error

2013-08-28 Thread Gerd Koetje
Why do i get this error?

(django-env)[root@python pythondating]# django-admin.py makemessages -l nl 
-i settings.py
processing language nl
CommandError: errors happened while running xgettext on .#models.py
xgettext: fout bij openen van './profielen/.#models.py' voor lezen: Bestand 
of map bestaat niet
(django-env)[root@python pythondating]# 

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Django Sites set current domain to site_id

2013-08-27 Thread Gerd Koetje
Hi all,

I got a django application that is called by difrant domains for the same 
code (some minor changes for each domain)


When i visit my application trough domain1.com or domain2.com its keep 
outputting data from the set site_id in settings
How can i change the site_id based on the incomming domain


so if i visit trough domain1.com it should set the site_id to  the id of 
domein1.com in the database , not the set site_id in settings.


How do i do this?

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


How to add a code table to this group?

2013-08-22 Thread Gerd Koetje
In many posts i submit django code.
I tried to use the < c o d e >  < / c o d e >  tag but it doesnt format it 
very nicely
Is there a other tags to use?

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Dynamic increasing choices object

2013-08-21 Thread Gerd Koetje
i used php to solve my issue for now, builded the object and copy pasted it





   ('',''),



-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Dynamic increasing choices object

2013-08-21 Thread Gerd Koetje

How do i automatic increase this from 40 tot 250kg
its a choices field inside of models.py

WEIGHTS = (

('40','40kg'),

('41','41kg'),  

)

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Populate choices from model

2013-08-21 Thread Gerd Koetje
example of what im doing



from django.db import models

from django.contrib.auth.models import User

from django.contrib.sites.models import Site



# Create your models here.


   

# formulier keuze databases


class Kleurogen_data (models.Model):

name = models.CharField(max_length=255)



def __unicode__(self):

return self.name


class Haarkleur_data (models.Model):

name = models.CharField(max_length=255)



def __unicode__(self):

return self.name



class Lengtehaar_data (models.Model):

name = models.CharField(max_length=255)



def __unicode__(self):

return self.name



class Landen (models.Model):

slug = models.CharField(max_length=255)

name = models.CharField(max_length=255)



def __unicode__(self):

return self.name


class Regio (models.Model):

slug = models.CharField(max_length=255)

name = models.CharField(max_length=255)

land = models.ForeignKey(Landen)



def __unicode__(self):

return self.name




# sitedeals


class Sitedetails(models.Model):

JANEE = (

('Y','Ja'),

('N','Nee'),  

)



TAAL = (

('Nederlands','Nederlands'),

('Engels','Engels'),  

)



site = models.ForeignKey(Site)

pub_date = models.DateTimeField('date published')



sitetekst = models.TextField()

beschrijving = models.TextField()

keywords = models.TextField()

google = models.TextField()



adult = models.CharField(max_length=2, choices=JANEE, default='N')

sitetaal = models.CharField(max_length=2, choices=TAAL, default=
'Nederlands')



dailxsid = models.CharField(max_length=255)   

smtploc = models.CharField(max_length=255)

smtpuser = models.CharField(max_length=255)

smtppass = models.CharField(max_length=255)



ontvangen = models.IntegerField(default=0)

verzonden = models.IntegerField(default=0)

aanmeldingen = models.IntegerField(default=0)

afmeldingen = models.IntegerField(default=0)

views = models.IntegerField(default=0)

profielen = models.IntegerField(default=0)





class Meta:

unique_together = ["site"]

verbose_name_plural = "Sitedetails"

app_label = 'sites'



def __unicode__(self):

return self.keywords

  

  

  

class Profielen(models.Model):

JANEE = (

('Y','Ja'),

('N','Nee'),  

)



GENDER = (

('Man','Man'),

('Vrouw','Vrouw'),  

)



  



profielnaam = models.CharField(max_length=255)

leeftijd = models.CharField(max_length=3)



issoort = models.CharField(max_length=10, choices=GENDER, default='Man')

zoektsoort = models.CharField(max_length=10, choices=GENDER, default=
'Vrouw')

adult = models.CharField(max_length=2, choices=JANEE, default='N')

partner = models.CharField(max_length=2, choices=JANEE, default='N')



regio = models.ForeignKey(Regio, default='Amsterdam')

land = models.ForeignKey(Landen, default='Nederland')





kleurogen = models.ManyToManyField(Kleurogen_data, blank=False, null=
False)

haarkleur = models.ManyToManyField(Haarkleur_data, blank=False, null=
False)

lengtehaar = models.ManyToManyField(Lengtehaar_data, blank=False, null=
False)



postuur = models.CharField(max_length=255)

gewicht = models.CharField(max_length=255)

afkomst = models.CharField(max_length=255)

gebjaar = models.CharField(max_length=255)

gebmaand = models.CharField(max_length=255)

gebdag = models.CharField(max_length=255)

lengte = models.CharField(max_length=255)

burgelijkestaat = models.CharField(max_length=255)

opleidingsniveau = models.CharField(max_length=255)

levensstijl = models.CharField(max_length=255)

ikvoelme = models.CharField(max_length=255)

inter = models.CharField(max_length=255)

haarstijl = models.CharField(max_length=255)

relatie = models.CharField(max_length=255)

cupmaat = models.CharField(max_length=255)

geaardheid = models.CharField(max_length=255)

sterrenbeeld = models.CharField(max_length=255)   

uiterlijkekenmerken = models.TextField()

belangstellingvoor = models.TextField()

beschrijving = models.TextField()

omschrijving = models.TextField()

algemenevoorkeuren = models.TextField()

sexvoorkeuren = models.TextField()

bdsmvoorkeuren = models.TextField()

sexkenmerken = models.TextField()

belangstelling = models.TextField()

omschrijvingengels = models.TextField()

beschrijvingengels = models.TextField()

likes = models.IntegerField(default=0)

views = models.IntegerField(default=0)

user = models.ForeignKey(User) 

 
 class Meta:

   verbose_name_plural = "Profielen"


def __unicode__(self):
return self.p

Re: Populate choices from model

2013-08-21 Thread Gerd Koetje
example of what im doing so far

from django.db import models

from django.contrib.auth.models import User

from django.contrib.sites.models import Site



# Create your models here.


   

# formulier keuze databases


class Kleurogen_data (models.Model):

name = models.CharField(max_length=255)



def __unicode__(self):

return self.name


class Haarkleur_data (models.Model):

name = models.CharField(max_length=255)



def __unicode__(self):

return self.name



class Lengtehaar_data (models.Model):

name = models.CharField(max_length=255)



def __unicode__(self):

return self.name



class Landen (models.Model):

slug = models.CharField(max_length=255)

name = models.CharField(max_length=255)



def __unicode__(self):

return self.name


class Regio (models.Model):

slug = models.CharField(max_length=255)

name = models.CharField(max_length=255)

land = models.ForeignKey(Landen)



def __unicode__(self):

return self.name




# sitedeals


class Sitedetails(models.Model):

JANEE = (

('Y','Ja'),

('N','Nee'),  

)



TAAL = (

('Nederlands','Nederlands'),

('Engels','Engels'),  

)



site = models.ForeignKey(Site)

pub_date = models.DateTimeField('date published')



sitetekst = models.TextField()

beschrijving = models.TextField()

keywords = models.TextField()

google = models.TextField()



adult = models.CharField(max_length=2, choices=JANEE, default='N')

sitetaal = models.CharField(max_length=2, choices=TAAL, default=
'Nederlands')



dailxsid = models.CharField(max_length=255)   

smtploc = models.CharField(max_length=255)

smtpuser = models.CharField(max_length=255)

smtppass = models.CharField(max_length=255)



ontvangen = models.IntegerField(default=0)

verzonden = models.IntegerField(default=0)

aanmeldingen = models.IntegerField(default=0)

afmeldingen = models.IntegerField(default=0)

views = models.IntegerField(default=0)

profielen = models.IntegerField(default=0)





class Meta:

unique_together = ["site"]

verbose_name_plural = "Sitedetails"

app_label = 'sites'



def __unicode__(self):

return self.keywords

  

  

  

class Profielen(models.Model):

JANEE = (

('Y','Ja'),

('N','Nee'),  

)



GENDER = (

('Man','Man'),

('Vrouw','Vrouw'),  

)



  



profielnaam = models.CharField(max_length=255)

leeftijd = models.CharField(max_length=3)



issoort = models.CharField(max_length=10, choices=GENDER, default='Man')

zoektsoort = models.CharField(max_length=10, choices=GENDER, default=
'Vrouw')

adult = models.CharField(max_length=2, choices=JANEE, default='N')

partner = models.CharField(max_length=2, choices=JANEE, default='N')



regio = models.ForeignKey(Regio, default='Amsterdam')

land = models.ForeignKey(Landen, default='Nederland')





kleurogen = models.ManyToManyField(Kleurogen_data, blank=False, null=
False)

haarkleur = models.ManyToManyField(Haarkleur_data, blank=False, null=
False)

lengtehaar = models.ManyToManyField(Lengtehaar_data, blank=False, null=
False)



postuur = models.CharField(max_length=255)

gewicht = models.CharField(max_length=255)

afkomst = models.CharField(max_length=255)

gebjaar = models.CharField(max_length=255)

gebmaand = models.CharField(max_length=255)

gebdag = models.CharField(max_length=255)

lengte = models.CharField(max_length=255)

burgelijkestaat = models.CharField(max_length=255)

opleidingsniveau = models.CharField(max_length=255)

levensstijl = models.CharField(max_length=255)

ikvoelme = models.CharField(max_length=255)

inter = models.CharField(max_length=255)

haarstijl = models.CharField(max_length=255)

relatie = models.CharField(max_length=255)

cupmaat = models.CharField(max_length=255)

geaardheid = models.CharField(max_length=255)

sterrenbeeld = models.CharField(max_length=255)   

uiterlijkekenmerken = models.TextField()

belangstellingvoor = models.TextField()

beschrijving = models.TextField()

omschrijving = models.TextField()

algemenevoorkeuren = models.TextField()

sexvoorkeuren = models.TextField()

bdsmvoorkeuren = models.TextField()

sexkenmerken = models.TextField()

belangstelling = models.TextField()

omschrijvingengels = models.TextField()

beschrijvingengels = models.TextField()

likes = models.IntegerField(default=0)

views = models.IntegerField(default=0)

user = models.ForeignKey(User) 



class Meta:

verbose_name_plural = "Profielen"


def __unicode__(self):

return 

Re: Populate choices from model

2013-08-21 Thread Gerd Koetje
i would vote for the m2m model, but i think i loose it there a bit

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Populate choices from model

2013-08-21 Thread Gerd Koetje
im building a prety complicated user detail form with all kinds of fields, 
like:  gender,haircolor,skincolor

some fields have to become dropdowns with only 1 choise out of many
and some fields have to become multiple select fields with alot of choise 
(multiple choises allowed)
I was trying to use 1 model that holds all the values for each field, but 
it seem to only work if i make a model for each field values

the dropdowns seem to work ok with foreignkey

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Populate choices from model

2013-08-21 Thread Gerd Koetje
 

regio = models.CharField(max_length=100, choices=Regio, default=
'Amsterdam')

land = models.CharField(max_length=100, choices=Landen, default=
'Nederland')

(django-env)[root@python pythondating]# python manage.py syncdb
CommandError: One or more models did not validate:
profielen.profielen: "regio": "choices" should be iterable (e.g., a tuple 
or list).
profielen.profielen: "land": "choices" should be iterable (e.g., a tuple or 
list).


it doesnt seem to accept a object




-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Populate choices from model

2013-08-21 Thread Gerd Koetje
Hi all,

How do i populate choices from a model class inside models.py

doenst work:

regio = models.CharField(max_length=100, choices=list(Regio), default=
'Amsterdam')
regio = models.CharField(max_length=100, choices=Regio, default='Amsterdam')



-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ManyToManyField select only results that match

2013-08-21 Thread Gerd Koetje
He Thomas, ur right i didnt explain myself very well.


What im trying todo is this.

I have a mode that holds all my form field values in difrant group , name: 
Keuzes  
Now i want to populate multiple form fields with these values based on wich 
groep i want them to be.
I onloy seem to get this to work if i make a difrant model for each field, 
cant i just use 1 model with a group field and select the value bases on 
the group i ask for?

I think im still a bit confused what i should do i models and what i should 
do in forms.





-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ManyToManyField select only results that match

2013-08-21 Thread Gerd Koetje
anyone willing to help out?

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ManyToManyField select only results that match

2013-08-20 Thread Gerd Koetje
mm that seems to not work when i do it on multiple field

kleurogen = models.ManyToManyField(Keuzes, blank=True, null=True)
kleurhaar = models.ManyToManyField(Keuzes, blank=True, null=True)


django.core.management.base.CommandError: One or more models did not 
validate:

profielen.profielen: Accessor for m2m field 'kleurogen' clashes with 
related m2m field 'Keuzes.profielen_set'. Add a related_name argument to 
the definition for 'kleurogen'.
profielen.profielen: Accessor for m2m field 'kleurhaar' clashes with 
related m2m field 'Keuzes.profielen_set'. Add a related_name argument to 
the definition for 'kleurhaar'.


and when i do this is shows all the results again instead of the selected

kleurogen = models.ManyToManyField(Keuzes, related_name='keuzes_kleurogen', 
blank=True, null=True)
kleurhaar = models.ManyToManyField(Keuzes, related_name='keuzes_kleurhaar', 
blank=True, null=True)



what am i doing wrong?

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ManyToManyField select only results that match

2013-08-20 Thread Gerd Koetje
i think i got it, i was foing it at the wrong spot.

i added this to my forms.py

kleurogen = 
forms.ModelMultipleChoiceField(queryset=Keuzes.objects.filter(groep_id=
'kleurogen'))


works like a charm

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


ManyToManyField select only results that match

2013-08-20 Thread Gerd Koetje
Hi all,

I got a form where i use a manytomany field likes this


kleurogen = models.ManyToManyField(Keuzes, blank=True, null=True)

This works fine but takes all the results from Keuzes
How can i only get the results from Keuzes that have the groep 'kleurogen'

i tried this but it doesnt work

kleurogen = models.ManyToManyField(Keuzes.objects.filter(groep_id=
"kleurogen"), blank=True, null=True)

AssertionError: ManyToManyField([, ]) is 
invalid. First parameter to ManyToManyField must be either a model, a model 
name, or the string 'self'

How can i do this?


in Keuzes i have

class Keuzes (models.Model):

name = models.CharField(max_length=255)

groep = models.ForeignKey(Keuzegroepen)



def __unicode__(self):

return self.name


-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


extending from django.contrib.sites.models import Site

2013-08-20 Thread Gerd Koetje
is it possible to extend  

from django.contrib.sites.models import Site


Coudlnt find any help related

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django signals to all connections?

2013-08-19 Thread Gerd Koetje
but can it also update a message on a page where that user is without 
reloading the page?

lets say user 1 is on page http://www.domain.com/acertainview/

and at that moment i start a signal as admin with the text hello there
Can i update the text on his page to that text (live)


Op maandag 19 augustus 2013 06:29:45 UTC+2 schreef Gerd Koetje:
>
> Is is possible to start an event at all connected users with signals?
> If this is possible can someone show me an example of it.
>
>
> Greetz
> Gerd
>
>

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django signals to all connections?

2013-08-19 Thread Gerd Koetje
omg god bless python/django..


So this really works?

user 1 is logged in to my app
user 2 is logged in to my app

As admin i send a signal with the text hello all and it will be printed on 
the page that user 1 and 2 are on?

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Django signals to all connections?

2013-08-18 Thread Gerd Koetje
Is is possible to start an event at all connected users with signals?
If this is possible can someone show me an example of it.


Greetz
Gerd

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django install existing project

2013-08-15 Thread Gerd Koetje
one of the errors i encounter when i just copy the project is:

_mysql_exceptions.OperationalError: (1193, "Unknown system variable 
'innodb_strict_mode'")

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django install existing project

2013-08-15 Thread Gerd Koetje
anyone willing to install it to see what i am doing wrong?
i tried to copy the contents but that gives me all sorts of errors

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django install existing project

2013-08-15 Thread Gerd Koetje
anyone willing to install it to see what i am doing wrong?
i tried to copy the contents but that gives me all sorts of errors

Op donderdag 15 augustus 2013 17:02:57 UTC+2 schreef Gerd Koetje:
>
> Hi,
>
> Im fairly new to django and trying to install a existing project
> https://github.com/ossobv/pstore
>
> Im kinda stuck on how to install this
> i tried pip install django-pstore and it installs something but when i 
> check the directory i dont see an pstore website directory
> i do find it in the site-packages
>
> im kinda confused how to get this properly installed
> anyone care to help me out a bit?
>

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Django install existing project

2013-08-15 Thread Gerd Koetje
Hi,

Im fairly new to django and trying to install a existing project
https://github.com/ossobv/pstore

Im kinda stuck on how to install this
i tried pip install django-pstore and it installs something but when i 
check the directory i dont see an pstore website directory
i do find it in the site-packages

im kinda confused how to get this properly installed
anyone care to help me out a bit?

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.