Re: CSRF verification failed when I use smart phone

2015-06-26 Thread Wim Feijen
Thanks Gergely, That solved it for me. Wim On Sunday, 31 May 2015 09:58:32 UTC+2, Gergely Polonkai wrote: > > I had this error when I had two Django application with the same domain > and both with the same (default) CSRF cookie name. Changing the cookie name > to something different solved

Re: session_key varies

2013-06-07 Thread Wim Feijen
Hi Tom, Thanks for making this clear! Now I explicitly save the session and everything works as supposed. Thanks again! Wim On 3 June 2013 15:19, Tom Evans <tevans...@googlemail.com> wrote: > On Mon, Jun 3, 2013 at 11:48 AM, Wim Feijen <w...@go2people.nl> wrote: > > Hi,

Re: Deployment Conundrum

2013-06-03 Thread Wim Feijen
Hi Daniel, I would definitely recommend ordering a small VPS (costs: maybe 10 euros a month) and go from there. Wim On Sunday, 2 June 2013 09:37:11 UTC+2, Daniel Braun wrote: > > Hello, > I'm working in a non-profit organization. It's a design archive and > research institute based in Israel.

Re: different admin form if adding a record

2013-06-03 Thread Wim Feijen
Hi Christian, I recommend defining your own ModelForm and using that in the admin. For an example using a custom form, see: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.form But why don't you want a choicefield in the admin then? Regards, Wim On

session_key varies

2013-06-03 Thread Wim Feijen
Hi, Is it normal that a session_key varies when a user is not logged in? And if so, should I then use request.COOKIES instead to store information in? In one of my projects, users can order a calendar and upload their own photos, one for each month. In between, I like to keep track of which

Re: how to import excel file into django models?

2013-06-03 Thread Wim Feijen
Hi, Yesterday I did some research on this topic and I would like to recommend looking at examples on github, for example: https://github.com/edcrewe/django-csvimport or https://github.com/foreveryh/django-excel-import But I didn't use any of them, because I decided to re-use my own code. Wim

image browsing from a textfield

2013-01-28 Thread Wim Feijen
Hello, For an e-learning app in development, we want editors to be able to edit html (TextField) within our app (not the admin), and insert formatted text, images and (Vimeo) video in there. At the moment, I am looking into using TinyMCE (django-tinymce) combined with django-filebrowser.

Re: How to use SESSION_COOKIE_DOMAIN on two subdomains

2011-09-19 Thread Wim Feijen
, 7:58 am, Wim Feijen <wimfei...@gmail.com> wrote: > Hello, > > I'd like to share the same session across two subdomains, namely: > crm.trumpetcms.nl > wtsadvocaten.trumpetcms.nl > > Do I have to set the SESSION_COOKIE_DOMAIN in both settings.py files? > Or just in

How to use SESSION_COOKIE_DOMAIN on two subdomains

2011-09-17 Thread Wim Feijen
Hello, I'd like to share the same session across two subdomains, namely: crm.trumpetcms.nl wtsadvocaten.trumpetcms.nl Do I have to set the SESSION_COOKIE_DOMAIN in both settings.py files? Or just in one? Is this line correct? SESSION_COOKIE_DOMAIN = '.trumpetcms.nl' I am hosting the projects

Am I overlooking something or is this a bug in ModelForm?

2011-08-31 Thread Wim Feijen
Hello, I am using a form which (simplified) looks like this: class AdvancedSearchForm(forms.ModelForm): email = forms.CharField(label='Emailadres', required=False) class Meta: model = Address fields = [ 'last_name', 'middle_name',

Re: templatetags and refresh

2011-06-24 Thread Wim Feijen
Thanks Bruno for your detailed advice and attention! I agree wholeheartedly. Wim On Jun 24, 12:53 pm, bruno desthuilliers wrote: > On Jun 24, 11:57 am,WimFeijen wrote: > > > > > Looking at it again, I saw what was wrong and fixed it! For > >

Re: templatetags and refresh

2011-06-24 Thread Wim Feijen
Daniel for your help! Wim On Jun 22, 8:24 pm, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Wednesday, 22 June 2011 14:32:10 UTC+1, Wim Feijen wrote: > > > Hello, > > > Atwww.mkb-rotterdam.nlwe use a template tag to display NewsItems in > > different

templatetags and refresh

2011-06-22 Thread Wim Feijen
Hello, At www.mkb-rotterdam.nl we use a template tag to display NewsItems in different formats on the homepage. However, when a new NewsItem is added, it does not appear at once. Might this have to do with the fact that we use a template tag to get the NewsItems out of the db? Our query is:

Re: admin won't load revisited

2011-01-27 Thread Wim Feijen
Hi Octopus, What do you mean by: "won't load correctedly"? Is there an admin interface at /admin/ ? If not, did you enable the admin in your settings.py and in your urls.py? Is there one or more object missing from the admin interface? If there is one missing, maybe you've made an error in your

Re: Askani

2010-11-26 Thread Wim Feijen
Nice! It definitely saves typing. Sounds like a right thing for newbies, because when I was a newbie, I always had to look up which fieldname to use and oh the typos. Wim On Nov 20, 3:28 pm, Alvaro Mouriño wrote: > Hi. > > I'd like to introduce to you this idea I've been

Re: Reusing actions "Save and continue editing" and "Save"

2010-11-26 Thread Wim Feijen
Hi Lom, I would recommend the following: 1. Add all three buttons to your template 2. In your view, handle the form saving and then determine which button has been pressed. 3. Accordingly, redirect to the same url (for example, redirect("/ address/14") for viewing, redirect("/address/14/edit")

Re: Building Privacy Options Like Facebook with Django

2010-11-26 Thread Wim Feijen
Hi Corey, I would recommend using a UserProfile for this, which is bound to a user (so make sure an authenticated user can access only his profile by using request.user.get_profile() in your views. See: http://docs.djangoproject.com/en/dev/topics/auth/ Good luck! Best regards, Wim On Nov 25,

Re: Central Login with Redirecting users based on Groups

2010-11-26 Thread Wim Feijen
In addition, you can use permissions to deny access for users to certain views by using the permission_required decorator, see: http://docs.djangoproject.com/en/dev/topics/auth/ Wim On Nov 25, 4:46 pm, Knut Ivar Nesheim wrote: > Hi Stefan, > > If you roll your own login view,

Re: extends a template that is stored in an app template directory

2010-11-26 Thread Wim Feijen
Hi Owidjaya, Common usage is to refer to your_app_name/template_name.html , so you can put for example {% extends "datagrid/template1.html" %} in your client template. So it is recommended to store your templates in a directory your_app_name/templates/your_app_name/template_name.html For more

Re: 'module' object has no attribute 'instancemethod' error

2010-08-18 Thread Wim Feijen
And I solved the problem as well, a new.pyc file was dangling somewhere in my project root, so that was why new.SomeThing didn't work. Oh, I'm happy now! On 18 aug, 16:13, Wim Feijen <wimfei...@gmail.com> wrote: > Nice app Reinout! This does really help in cleaning up! > > Unfortu

Re: 'module' object has no attribute 'instancemethod' error

2010-08-18 Thread Wim Feijen
Nice app Reinout! This does really help in cleaning up! Unfortunately, it does not solve this problem. But I'll try to dig some deeper. On 11 aug, 13:19, Reinout van Rees wrote: > On 08/10/2010 09:53 PM, WimFeijenwrote: > > > Exception Type: ViewDoesNotExist at / > >

Re: filter users by group

2010-08-18 Thread Wim Feijen
So simple and so great! Thanks! On 11 aug, 21:50, Nick wrote: > You can subclass the User admin and then unregister the default admin > and register your new subclassy admin (subclassy is a word) > > in admin.py: > > from django.contrib.auth.admin import UserAdmin > from

filter users by group

2010-08-11 Thread Wim Feijen
Hello, I am banging my brain against the wall but it doesn't help and all I get is brain damage. Maybe you can help me find a solution for the following problem? How can I add a filter to the django admin User interface (/admin/auth/ user/) so I can filter Users by Group? What I have thought

'module' object has no attribute 'instancemethod' error

2010-08-10 Thread Wim Feijen
Hi, When using reportlab trying to import a file which contains the following line, I get an error. from reportlab.platypus import Paragraph The error says: ViewDoesNotExist at / Tried book in module book.address.views. Error was: 'module' object has no attribute 'instancemethod' The trace is

Re: limit on date in postgres/django

2010-06-09 Thread Wim Feijen
09/06/10 12:23, Wim Feijen wrote: > > > Hello, > > > Do you know whether there is a minimum to a date? > > Well there is, at the postgresql level, dates are supported > between 4713 BC and 5874897 AD > > http://www.postgresql.org/docs/8.4/static/datatype-datetim

limit on date in postgres/django

2010-06-09 Thread Wim Feijen
Hello, Do you know whether there is a minimum to a date? In my project, I'd like to add birthdays from way back, from people born on 21 january 0061 for example. When trying to write these dates to the db, I get the following error. I'm using Django 1.0.5 alpha and Postgres 8.3.9. --- Traceback

Re: formsets and empty results

2010-05-17 Thread Wim Feijen
idation/#ref-forms-... > > <http://docs.djangoproject.com/en/1.1/ref/forms/validation/#ref-forms-...> > Grtz > > > > > > On Sat, May 15, 2010 at 7:34 PM, Wim Feijen <wimfei...@gmail.com> wrote: > > Hi all, > > > Can some of you please help me

formsets and empty results

2010-05-15 Thread Wim Feijen
Hi all, Can some of you please help me with the following? For an application, I need to display the same form ten times over. Filling in each form is optional. Of course, I'd like to keep this safe & simple and therefore I am looking at formsets. Is it possible to use a formset, call

DateFormat and localization

2010-03-26 Thread Wim Feijen
Hi, I'm unsure if and how to use DateFormat from django/utils/ dateformat.py . I'd like to use a local (Dutch) representation of dates. What I get is: u'26th March 2010' I'd like that to be in Dutch. How do I do that? Major thanks! Wim My IPython looks like this: In [1]: import

Re: admin rows aren't ordered as expected

2010-03-09 Thread Wim Feijen
OK Thanks! That explains a lot. Wim On Mar 8, 2:54 pm, derek <gamesb...@gmail.com> wrote: > On Mar 8, 2:46 pm, Wim Feijen <wimfei...@gmail.com> wrote: > > > > > > > Hello, > > > In my admin interface, the data isn't ordered as expected. What I get

admin rows aren't ordered as expected

2010-03-08 Thread Wim Feijen
Hello, In my admin interface, the data isn't ordered as expected. What I get is: Provincie/Land Type Limburg Provincie Groningen Provincie Utrecht Provincie etc. which clearly isn't alphabetical order, while I do specify that provinces should be ordered that way. In my python

save method manytomany

2010-01-18 Thread Wim Feijen
Hi, Will you help me please? I've got a model called Card which has a ManyToMany relationship to Tag. When I save a Card, I'd like to create a Product as well, which I want to have the same ManyToMany relationship to tag. How do I access the instance's tags? self.tags.all() gives an empty list,

Re: Modeling and validating international addresses?

2009-09-27 Thread Wim Feijen
Hi ringmeup again, What I would do is choose the most common one and use that. In many web applications I find that people use American-style addresses, where I have to enter my state which has no equivalent in the Netherlands, but nevertheless I have to. Another good solution would be to

Re: Overriding verbose_name in contrib or 3rd-party apps?

2009-09-27 Thread Wim Feijen
Can you please post some more information for what purpose you like to do this? My first guess would be you are using the admin interface. Dirty workarounds are: copying code and adapting it, importing from your adaptation in stead of the original. Maybe modifying the admin view to do something

Re: can't show admin interface

2009-09-27 Thread Wim Feijen
It does nothing to help you solve your problem, but mod_wsgi is generally preferred above mod python. Good luck solving the problem! Wim On Sep 26, 10:06 am, nausikaa wrote: > Have you done > > from yourapp.models import * > from django.contrib import admin > >

Re: rendering a table

2009-09-27 Thread Wim Feijen
Hi Hugo, Your template code, does it actually contains and ? Like below? {% for row in rows %} {% for value in row %} {{ value }} {% endfor %} {% endfor %} Then, what does rows look like? Can you post your output please? To get this output, for example, use "print rows" before you render

Re: OperationalError: unable to open database file, when saving existing object

2009-09-27 Thread Wim Feijen
So, if I understand correctly, creating new objects and saving them to the database works correctly, and updating objects fails. Is that correct? Is it an update from the admin interface or from code written by you? If the former, it might have something to do with db privileges. Which back-end

question about UserChangeForm

2009-06-11 Thread Wim Feijen
Hello, In my views, I'd like to be able to rename a user using the UserChangeForm from django.contrib.auth.forms . However, the form does not validate. Should I use another instance than request.user? Errorlist: Translation: "Dit veld is verplicht." is Dutch for "This field is required."

syncdb no such table: auth_group

2009-06-05 Thread Wim Feijen
Hello, python manage.py syncdb failed for me, saying: there is no such table auth_group. On closer examination, the error stack mentioned one of my models: timewriting. After commenting 5 lines of code: tada... syncdb worked! However, I do not understand, and I am interested in: why ? Wim

Re: form fun

2009-05-30 Thread Wim Feijen
The source code for the form generator is now on github at: http://github.com/wimfeijen/trumpet_form_generator - Wim On May 30, 7:29 pm, Wim Feijen <wimfei...@gmail.com> wrote: > Hello, > > Several clients asked me whether they could have a form on their > website, w

form fun

2009-05-30 Thread Wim Feijen
I'll look into that. Cheers, Wim Feijen --~--~-~--~~~---~--~~ 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 em

Re: Forms: custom clean for DateField

2009-03-18 Thread Wim Feijen
Hi Marco, In Django 1.0, you don't need to call clean from clean, Django will do that automatically for you. :) So what you can do is: def clean(self): data = self.cleaned_data if (data['firstDate'] >= data['lastDate']): raise ValidationError("Error")

thread by latest post

2008-12-04 Thread Wim Feijen
Hello, While writing a forum app, I ran into a problem: I am unable to sort a list of threads by date of their latest post. My models look like: class Thread(models.Model): club = models.ForeignKey(Club) name= models.CharField(_('Thread'), max_length=100) date =

Re: pretty urls lost in dns

2008-09-24 Thread Wim Feijen
OK, please ignore the above. Turns out that I am not using DNS at all, but iframes. It will take some time for the DNS to pick up, but let's see how it works after that. Wim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

pretty urls lost in dns

2008-09-24 Thread Wim Feijen
Hello, I'm happily running a project on a Strato web server. I've forwarded the domain name 'uwadresboek.nl' to my server, it's at IP 85.214.104.194 . Everything works fine, except that: 1. Pretty URLs are lost. I can type www.uwadresboek.nl/prices and everything is well. In addition, I can

Re: Django 1.0 lighttpd FastCGI redirect issue

2008-09-16 Thread Wim Feijen
Hi Anders, For me, removing the slash in the FORCE_SCRIPT_NAME seemed to work. I am not using the admin interface, so I can't check on that. So I added to settings.py: FORCE_SCRIPT_NAME="" I totally agree that this change with great consequences for all lighttpd users is poorly documented.

Re: Can I loop over attributes in model.attribute?

2008-06-13 Thread Wim Feijen
Works like a charm, thank you very much! On Jun 12, 2:09 am, Johannes Dollinger <[EMAIL PROTECTED]> wrote: > You are looking for setattr():http://docs.python.org/lib/built-in- > funcs.html#l2h-66 > > for attr in ('groupon', 'companyon', 'addressfirst', 'extendnames',   > 'clubfieldson'): >      

Re: Can I loop over attributes in model.attribute?

2008-06-11 Thread Wim Feijen
Thanks Russell! I suppose the code I want to get looks like: settings = Settings.objects.get(owner=userid) for switchable in ['groupon', 'companyon', 'addressfirst', 'extendnames', 'clubfieldson']: if switchable in data: settings._meta.get_field(switchable). = True else:

Re: sessions, Internet Explorer cookies and domain forwarding

2008-06-11 Thread Wim Feijen
Many thanks Peter for your help in identifying the problem! After making an upgrade in my domainhosting package I can use DNS and now I am okay: setting the cookie works. Yes! I am a very happy person now, thanks again! Wim On Jun 5, 5:27 pm, Peter Rowell <[EMAIL PROTECTED]> wrote: > Sigh,

Can I loop over attributes in model.attribute?

2008-06-10 Thread Wim Feijen
Coding happily away... And wondering, can I write better code, using a loop, perhaps? In other words: can I set settings.groupon while using a variable in stead of groupon? Thanks for any recommendations you are willing to make! Wim Feijen --- My not-too-pretty code: settings

sessions, Internet Explorer cookies and domain forwarding

2008-06-05 Thread Wim Feijen
Hello everyone, Django is great. But I am experiencing a problem when trying to log in to my site using Internet Explorer. When I go to: http://85.214.104.194:8098/accounts/login/ logging in works as it should. However, at: http://www.jouwadresboek.nl/ , which is hosted at Strato and forwarded

Re: use my own widgets when creating a form out of a model

2008-06-05 Thread Wim Feijen
can of-course do this with any field and use any widget for said field. > > Best, > > R > > On Wed, Jun 4, 2008 at 6:49 PM, Wim Feijen <[EMAIL PROTECTED]> wrote: > > > Hello people, > > > Being able to work with Django is very helpful to me. However, I am >

use my own widgets when creating a form out of a model

2008-06-04 Thread Wim Feijen
Hello people, Being able to work with Django is very helpful to me. However, I am unsure whether I can create a form out of a database model and then customize that form. Using widgets to increase the textarea to 40 would be great! But after reading the documentation I am convinced I cannot do