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-p

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://gi

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

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 r

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 email

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

Re: Django signals to all connections?

2013-08-19 Thread Gerd Koetje
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 G

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-u

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 kle

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" gr

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: Acces

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 djang

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 t

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 sub

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.profi

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 us

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

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_lengt

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

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

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+unsub

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 rec

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 incommin

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

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

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.

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 subscr

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'))

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

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

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 {%

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

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

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

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 po

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...@googl

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 g

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...@googlegro

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+unsubs

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

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 ge

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.V

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...@googlegrou

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 unsub

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...

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 prof

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 retur

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 rece

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

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

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 grou

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)

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, sen

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

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

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-us