Adding a custom permission to the User model

2008-10-21 Thread Benedict Verheyen
Hi, I'm trying to specify a custom permission on the User model. I would use it to delegate control to users over certain models. I have an admin.py file where i add this: from django.contrib.auth.models import User ... class UserAdmin(admin.ModelAdmin): class Meta: permissions = (

Re: Adding a custom permission to the User model

2008-10-24 Thread Benedict Verheyen
Benedict Verheyen wrote: > Hi, > > I'm trying to specify a custom permission on the User model. > I would use it to delegate control to users over certain models. > > I have an admin.py file where i add this: > > from django.contrib.auth.models import

Re: File upload problem

2008-10-29 Thread Benedict Verheyen
Roodie wrote: > Hello, > > I have an interesting problem. One of the users of my ( test ) django > site reported that he cannot upload image banners to the site using > the custom admin. I've checked the logs, and found the following > exception logged: > > Traceback (most recent call last): >

best practice to change allowed characters in a username

2008-10-29 Thread Benedict Verheyen
Hi, i want to know what the best practice is for following problem. I use the built in user authentication framework. I've already made the login authenticate against our AD. Works fine (see http://www.djangosnippets.org/snippets/901/) In our company, usernames are specified with a period betw

Re: best practice to change allowed characters in a username

2008-10-29 Thread Benedict Verheyen
Jarek Zgoda wrote: > You have to unregister the admin class for User model before > registering your own. Thanks, that seems to solve the register error. However, the other question remains, is the way i'm going about to change the allowed characters ok? Thanks, Benedict --~--~-~--~

Re: Adding a custom permission to the User model

2008-10-30 Thread Benedict Verheyen
Benedict Verheyen wrote: > When i do python manage.py syncdb i don't see anything written to the > db. The permission is also not visible from within the users part of the > admin site. I found out that the syncdb command didn't work. I deleted a table and after i did th

Re: Adding a custom permission to the User model

2008-10-30 Thread Benedict Verheyen
Benedict Verheyen wrote: > > Now i need to find out how i can make the syndb command aware of the > models in that subdirectory. Can i trigger this from the __init__.py > file that lives in the main application directory? I added the directory (project.app.modeldir) to the INSTALL

date formats in settings.py

2008-11-06 Thread Benedict Verheyen
Hi, i have a question on the different date/time settings one can specify in the settings.py. I currently have these: TIME_ZONE = 'Europe/Brussels' DATE_FORMAT = 'd/m/Y' DATETIME_FORMAT = 'd/m/Y H:i' TIME_FORMAT = 'H:i' YEAR_MONTH_FORMAT = 'm Y' MONTH_DAY_FORMAT = 'd m' However, any date i ente

Re: date formats in settings.py

2008-11-06 Thread Benedict Verheyen
Karen Tracey wrote: > On Thu, Nov 6, 2008 at 11:30 AM, Benedict Verheyen > <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: > > > Hi, > > i have a question on the different date/time settings one can specify in > the settings.py. >

Re: date formats in settings.py

2008-11-07 Thread Benedict Verheyen
Benedict Verheyen wrote: I have solved it in my view. However, i'm not sure this is the best way to deal with it. In my view i set the input_formats of the datefield like this: report_f = ReportForm(request.POST,instance=r) report_f.base_fields['date_reported'].input_forma

Re: getting request.user into a ModelForm?

2008-11-07 Thread Benedict Verheyen
Rob Hudson wrote: > I have the following: > > ## MODELS > > class Category(models.Model): > user = models.ForeignKey(User) > name = models.CharField(max_length=200) > > class Link(models.Model): > user = models.ForeignKey(User) > category = models.ForeignKey(Category) > name

Re: Hosting with support for Satchmo webstore

2008-08-25 Thread Benedict Verheyen
David Zhou wrote: > On Aug 25, 2008, at 8:02 AM, Chris Moffitt wrote: > >> On Mon, Aug 25, 2008 at 5:17 AM, Benedict Verheyen <[EMAIL PROTECTED] >>> wrote: >> Hi, >> >> i need to develop a website with a webstore and i thought it was >> the pe

Hosting with support for Satchmo webstore

2008-08-25 Thread Benedict Verheyen
Hi, i need to develop a website with a webstore and i thought it was the perfect time to use Django & more specific Satchmo. However, Satcho has a big list of requirements and i'm not sure if this will work with the usual providers that have Django enabled. These are the requirements: * Elementtr

ProgrammingError at /admin/, date/time field value out of range

2008-09-03 Thread Benedict Verheyen
Hi, on a Debian Etch system, i use Django svn (rev 8911) with Postgres 7.4. Other components are Apache2 (v. 2.2.3-4) & mod_python. I created the database with this command: createdb -E ENCODING UNICODE -U postgres testdb python manage syncdb runs without a problem. I installed all compone

Re: ANNOUNCE: Django 1.0 released

2008-09-03 Thread Benedict Verheyen
James Bennett schreef: > The Django team is pleased to announce the release of Django 1.0 this evening: > > Download: http://www.djangoproject.com/download/ > Release notes: http://docs.djangoproject.com/en/dev/releases/1.0/ > > Have fun with it, and we'll see you in a few days for DjangoCon. >

Re: ProgrammingError at /admin/, date/time field value out of range

2008-09-03 Thread Benedict Verheyen
Chubby schreef: > > > I forgot to mention the following. When i execute the sql statement > from above directly > on the database, it works. No error what so ever. > So the db configuration would appear to be correct. > > What could be causing this error ? > > Thanks, > Benedict When i use wr

Re: ProgrammingError at /admin/, date/time field value out of range

2008-09-04 Thread Benedict Verheyen
ekellner schreef: > The expected date format is a per-connection level setting. (Called > "DATESTYLE" in postgresql). There is also a default format if the > connection doesn't specify. > > I strongly suspect that this mismatch between formats is actually > happening between the database a

Re: ProgrammingError at /admin/, date/time field value out of range

2008-09-04 Thread Benedict Verheyen
Benedict Verheyen schreef: > Thanks for the info. > I'm seems i'm unable to set the correct datestyle to get this to work. > > When i run it from a python shell, i do indeed get the same error: > > python manage shell > >>> from django.db

Re: ProgrammingError at /admin/, date/time field value out of range

2008-09-04 Thread Benedict Verheyen
Benedict Verheyen schreef: > > I did some more testing > When i execute the sql from the psql command line, the first time it gives an > error, the 2nd time it doesn't ?! How weird is that :) > Date style is set to 'iso, ymd' > > psql webshop >

possible bug in django-admin

2008-09-09 Thread Benedict Verheyen
Hi, i tried to do a django-admin startproject and it said that startproject wasn't a valid command. Weird. django-admin help indeed didn't show the startproject command. Checked /usr/lib/python2.4/site-packages/django/core/management/__init__.py And in the get_commands function, there is a del

Re: possible bug in django-admin

2008-09-10 Thread Benedict Verheyen
James Bennett wrote: > On Tue, Sep 9, 2008 at 4:15 AM, Benedict Verheyen > <[EMAIL PROTECTED]> wrote: >> i tried to do a django-admin startproject and it >> said that startproject wasn't a valid command. >> Weird. django-admin help indeed didn't sho

Re: possible bug in django-admin

2008-09-11 Thread Benedict Verheyen
Karen Tracey wrote: > It's not trying to limit you to just one project. It's just trying to > prevent confusion by not letting you create and attempt to work with a > new project when you're running in an environment already set up to > manage a different project. In those cases, simply unset

Re: danjgo authentification

2010-04-22 Thread Benedict Verheyen
On 22/04/2010 15:46, Shawn Milochik wrote: Everything you need is here: http://docs.djangoproject.com/en/1.1/topics/auth/#authentication-in-web-requests This will tell you exactly, in detail, how to create your own login page to tie into the built-in authentication.

Sorting objects according to a field from a foreign field

2010-06-22 Thread Benedict Verheyen
I have an issue sorting objects. First, let me explain the models i'm using: class Call(models.Model): ... priority = models.ForeignKey(Priority) class Priority(models.Model): title=models.CharField(max_length=30) description=models.CharField(max_length=255) weight=models.Inte

Re: Sorting objects according to a field from a foreign field

2010-06-22 Thread Benedict Verheyen
On 22/06/2010 16:42, Daniel Roseman wrote: > > As described in the documentation [1], you use the double-underscore > syntax for sorting across relationships. > Call.objects.all().order_by('-priority__weight') > > [1]:http://docs.djangoproject.com/en/1.2/ref/models/querysets/#order- > by-fiel

generate cache by visiting protected links

2010-07-28 Thread Benedict Verheyen
Hi, i have cache enabled on a few heavy statistical views. I would like to generate the pages before a user goes to that page and maybe even regenerate the pages every hour to avoid the initial delay. However, i can't seem to automate the caching as my site's authentication gets in the way of a

Re: HTTP POST sent from app to Django Server returns 403 Forbidden

2010-07-28 Thread Benedict Verheyen
On 28/07/2010 3:54, Kieran Farr wrote: > Further research shows that CSRF is enabled regardless of my > settings.py if we use Django's built-in auth. > > Obviously, we need to still use Django's auth, so we can't just > disable CSRF site-wide like this hack: > http://stackoverflow.com/questions/16

Re: Help:How to post data to the admin form by urllib2 ?

2010-07-28 Thread Benedict Verheyen
On 27/07/2010 17:48, jerry wrote: > Hi: > I build a website and want to login the admin form by python code. I > have disabled the CSRF in my project and use urllib2 to post data. > here are my codes: > -

Re: HTTP POST sent from app to Django Server returns 403 Forbidden

2010-07-29 Thread Benedict Verheyen
On 28/07/2010 18:22, Kieran Farr wrote: > Thanks, David -- you're right on, now I just return an HttpResponse > with result code 404. > > Benedict, could you post the view for /management/statistics/top/user/ > yearly/ that is causing the 403? > > Kieran > Yes, here it is. Depending on wether

Re: generate cache by visiting protected links

2010-07-29 Thread Benedict Verheyen
On 28/07/2010 18:51, Jirka Vejrazka wrote: > > Hi, > > is the statistics user-dependent? > > If not, just create a cron job (or similar, depending on your > platform) that will calculate the statistics every hour and maybe even > create the main blocks of the page to be displayed. > >

Re: generate cache by visiting protected links

2010-07-29 Thread Benedict Verheyen
On 29/07/2010 15:41, Jirka Vejrazka wrote: >>ret_val = stats_top_callers_per_year(_request) >>cache.set(reverse("stats_top_callers_per_year"), ret_val) > > Hi, > > it's your code and I won't try talk you out of it :) > > However, I don't see any reason why you couldn't call > "stats

Re: generate cache by visiting protected links

2010-07-29 Thread Benedict Verheyen
On 29/07/2010 17:53, David De La Harpe Golden wrote: > On 29/07/10 16:16, Jirka Vejrazka wrote: > > >> I personally don't like spawning another thread in a >> request-response cycle, but if it works for you, be happy with it :) > > IIRC it's not really safe, at least in the django/apache case, t

Re: generate cache by visiting protected links

2010-07-29 Thread Benedict Verheyen
On 29/07/2010 17:16, Jirka Vejrazka wrote: > Well, it probably depends on the frequency od data change as well as > other factors. I personally don't like spawning another thread in a > request-response cycle, but if it works for you, be happy with it :) > > Based on the print statement on you

Re: generate cache by visiting protected links

2010-07-30 Thread Benedict Verheyen
On 29/07/2010 21:10, Jirka Vejrazka wrote: >> That's why i asked on what Django uses as a key to set and entry in the >> cache. >> If i generate the page and put it on the cache and then rely on Django to >> get it, >> the key i use needs to be the same as Django uses otherwise the page isn't >>

Re: generate cache by visiting protected links

2010-07-30 Thread Benedict Verheyen
On 29/07/2010 18:48, David De La Harpe Golden wrote: > On 29/07/10 16:58, Benedict Verheyen wrote: > >> So calling a thread once from within a view is not safe ? > > Depends on what your expectations are... > > I haven't managed to dig up the paragraph discuss

Re: generate cache by visiting protected links

2010-07-30 Thread Benedict Verheyen
On 30/07/2010 12:06, Jirka Vejrazka wrote: >> I still have 2 approaches i can take. > > I still believe that there is a 3rd option there - to bypass the > view / auth / login machinery completely :) > > > If your primary goal is to cache the statistics and the statistics > does not depend on

Advice needed on bundling applications

2010-09-07 Thread Benedict Verheyen
Hi, i've written a calltracking application for my company and other apps will follow soon. Now, i would want a central way to access them and to assign rights on who can see and run what application. The dashboard or access panel will be very simple: icons that link to the application and bas

Re: Advice needed on bundling applications

2010-09-09 Thread Benedict Verheyen
On 7/09/2010 10:45, Benedict Verheyen wrote: > Hi, > > > i've written a calltracking application for my company and other apps will > follow soon. > Now, i would want a central way to access them and to assign rights on who > can see > and run what application. &g

Relationship between multiple sites & projects, apps

2010-09-23 Thread Benedict Verheyen
Hi, it's not exactly clear to me how the sites, projects and apps need to be structured. For instance, if you have 2 sites both with a domain name, how would you structure this in Django? The Django project could be called "mysites" or whatever name. In the admin site, you would then have 2 si

Re: Relationship between multiple sites & projects, apps

2010-09-24 Thread Benedict Verheyen
c to different areas of our site since we can always break out more > servers to handle different virtual hosts. If it was all one > django project I don't think you could allocate infrastructure this > granularly. > > my 2 cents, but I'd love to hear what others think

Re: Django Accounts - User account 'component'

2010-09-24 Thread Benedict Verheyen
On 23/09/2010 18:04, Guiga wrote: > Hi guys, > > I'd like to know if django have a "component" (or some like this) to > create, edit and login user's accounts. I mean, some like a system > user accounts to work with django. > > Thanks. > Hi, as mentioned you can use the authentication system o

Re: SITE_ID

2010-09-27 Thread Benedict Verheyen
On 25/09/2010 18:32, Tim Sawyer wrote: > On 25/09/10 15:57, craphunter wrote: >> Yes, I have read it, but I don't really get it. What is the meaning of >> it? > > Consider a website that has multiple blogs, all of which are deployed to the > same database. > > Consider that you want each blog to

Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Benedict Verheyen
On 27/09/2010 9:08, MrMuffin wrote: > Where do you put your business logic in django? In my project I`ve put > it into the models.py, but that file soon become huge and hard to > maintain. Of course I can just stuff it into whatever file I like, but > I`d like to have some standard way of doing thi

Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-28 Thread Benedict Verheyen
On 27/09/2010 23:59, Diederik van der Boor wrote: > SInce watching that video, my projects are composed by default of 2 apps. A > "projectname" for the core backend stuff, and a "projectname-site" with the > templates, settings, and frontend media. This is imho a nicer base to start > "hooking

Re: SITE_ID

2010-09-28 Thread Benedict Verheyen
On 27/09/2010 12:19, Tim Sawyer wrote: >> On 25/09/2010 18:32, Tim Sawyer wrote: >>> On 25/09/10 15:57, craphunter wrote: Yes, I have read it, but I don't really get it. What is the meaning of it? >>> >>> Consider a website that has multiple blogs, all of which are deployed to >>> the sam

Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-28 Thread Benedict Verheyen
On 28/09/2010 0:48, bruno desthuilliers wrote: > > > On 27 sep, 17:31, Thomas Weholt wrote: >> On Mon, Sep 27, 2010 at 4:52 PM, bruno desthuilliers >> > >>> ??? Which "django specific magic" ??? >> >> I was referring to syncdb. As far as I know, models defined outside >> any models.py or models

Separating application media from project media

2010-09-29 Thread Benedict Verheyen
Hi, I want to further split my application from the project. I've already put the templates inside the application directory. Now I'm thinking of doing the same with media. I think it's clearer if the media of the application is separate from the project. I'm not sure however if the application

Re: Separating application media from project media

2010-09-29 Thread Benedict Verheyen
On 29/09/2010 13:13, David De La Harpe Golden wrote: > On 29/09/10 09:34, Benedict Verheyen wrote: > >> In my template i add this: >> > href="{{MEDIA_URL_CALLTRACKING}}/style/login.css" /> >> > > (I'd favour prefix rather than suffix if you&#

Re: Separating application media from project media

2010-09-30 Thread Benedict Verheyen
On 29/09/2010 13:58, Benedict Verheyen wrote: > On 29/09/2010 13:13, David De La Harpe Golden wrote: >> On 29/09/10 09:34, Benedict Verheyen wrote: >> >>> In my template i add this: >>> >> href="{{MEDIA_URL_CALLTRACKING}}/style/login.css" />

Re: Separating application media from project media

2010-09-30 Thread Benedict Verheyen
On 29/09/2010 18:55, Carles Barrobés wrote: > At some point I also thought this was a good idea. This way I can > reuse the app and all its visual stuff as well. > > But the problem is that for most cases you will want your templates > and media to be consistent with a site's design and look&feel.

Re: Separating application media from project media

2010-10-01 Thread Benedict Verheyen
On 1/10/2010 10:06, bruno desthuilliers wrote: > I don't think that's the case, and FWIW the OP's layout makes perfect > sense to me. His point is that even while all apps are in a same > project and share a common auth, they are otherwise totally (or > mostly ?) independent so it doesn't really ma

Re: UnicodeEncodeError

2010-10-01 Thread Benedict Verheyen
On 30/09/2010 18:47, jean polo wrote: > ok, thanks to everybody for the help but unfortunately nothing works > for my issue. > (except Karen one that solves it on one of my local machines but not > the other which has the same linux system... weird..). > > I guess I'll ask my client to rename thei

Re: Separating application media from project media

2010-10-06 Thread Benedict Verheyen
On 1/10/2010 11:48, bruno desthuilliers wrote: > This is fine when using the dev server, but what when you will serve > your static files directly from the frontend web server ? Hi Bruno, to answer your question, i'll post the relevant parts of configs. I use apache with the wsgi module, nginx f

related forms on 1 page

2010-03-10 Thread Benedict Verheyen
Hi, i'm developing a simple calltracking application. I want to have a page where you can fill out info on a call and fill in 1 or more related actions. The models call & action look like this (mind i'm still in the early stages of development :)) class Call(models.Model): class Meta:

error when updating

2010-03-18 Thread Benedict Verheyen
Hi, i have a problem when saving a form for updating. In my model, i have a field date_created. Now when i edit the form, i don't want that field to be editable and thus is don't include it in the field list. I have specified a form where i specify the fields that i want to see on the form. I h

Re: error when updating

2010-03-18 Thread Benedict Verheyen
ge...@aquarianhouse.com wrote: > Hi, > > I hope I understood it right. You could set the field to > editable=False, the rest Django will take care. > > Btw, you have a typo "attachement" should be "attachment" I think. > Thanks for the info & finding the typo. Setting the field to editable=Fals

Re: error when updating

2010-03-18 Thread Benedict Verheyen
ge...@aquarianhouse.com wrote: > You Welcome. > > I guess is the combination between POST nad instance data. > > did you try only: > > form = ActionForm(request.POST) > > because in POST is already the data posted. > > you might have like this before the form: > > def view_name(request): >

Re: error when updating

2010-03-19 Thread Benedict Verheyen
Benedict Verheyen wrote: > > This is the code in my update view: > > def action_edit(request, action_id): > action = get_object_or_404(Action, pk=action_id) > if request.method == 'POST': > form = ActionForm(request.POST, act

Re: error when updating

2010-03-19 Thread Benedict Verheyen
Benedict Verheyen wrote: > Benedict Verheyen wrote: > > As expected, it works if i set the values in my view: > > action = get_object_or_404(Action, pk=action_id) > form=ActionForm(instance=action) > if request.method == 'POST': > form = ActionF

Re: How to do dynamic lookup of variables.

2007-02-14 Thread Benedict Verheyen
Mike Lake schreef: > Hi all > > Im trying to place into a list of experiments the number of procedures for > each experiment. > From within the views.py I can save the number of procedures in an experiment > into either a list of tuples (e.id, count) or a dictionary {'e.id': count}. > But when

Re: iteration of query set appears to fail when running function directly from interpretor

2007-02-15 Thread Benedict Verheyen
Merric Mercer schreef: > Help! I have a function that is provided below. When I try the > individual lines of the function through the interpretor (Ipython) > everything works as expected. For example:- > > >> qset=PointTransaction.objects.filter etc this works fine!! > > However

Re: iteration of query set appears to fail when running function directly from interpretor

2007-02-15 Thread Benedict Verheyen
or no objects. Then you assign the balance value and save it. If you are running on the development server, you can use print statements to check you code. If you're on production, you can use the logging package to achieve printing debugging messages in a file. Regards, Benedict

Re: How to do dynamic lookup of variables.

2007-02-15 Thread Benedict Verheyen
Michael Lake schreef: > Yes it does work, thanks heaps. I presume though that the render_to_return is > outside > of the previous for loop as below. Yes it's outside the loop as you already found out. > for e in experiment_list: > e.proc_count = e.experiment_procedure_set.all().count() >

Re: HTTP_REFERER

2007-02-19 Thread Benedict Verheyen
Pythoni schreef: > I would like to use HTTP_REFERER in my Django project to find out from > where users came to my website. So, my first page is INDEX.HTML that > uses > def Index(request) procedure. > In this def Index(request) I use > request.META['REMOTE_ADDR'] > but I found out that Referer do

how to get a reference to a authenticated user

2007-02-20 Thread Benedict Verheyen
Hi, i have some tables that i want to link with an authorized user. Right now i use the login mechanism of django. 1. Is it possible to specify a foreign_key to the auth_user database? If not, what is the best way to have a "user" field in a table that refers to a logged in user? 2. How can i g

Re: how to get a reference to a authenticated user

2007-02-20 Thread Benedict Verheyen
Russell Keith-Magee schreef: Thanks for the answers (super quick !) Russell en Honza. I'll try it out at once, Thanks, Benedict --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

ImageField and adding username to the path

2007-02-21 Thread Benedict Verheyen
Hi, in my application, i want to enable the users to upload pics. These pictures are thus linked to the user. I want to reflect that on a filesystem bases by saving the pics in a directory that also has the authenticated user. Getting the authenticated user isn't a problem, customizing the path

Re: Using HTML/CSS as templates

2007-02-27 Thread Benedict Verheyen
MattW schreef: > Dear Group, > > I've got an HTML page with associated CSS that I want to use as my > template. Just to test it, I call: > > return render_to_response('about.html') > > and I get the page, but with no CSS info. I've checked the page > source, and it has the name of the styleshee

Re: newforms: no attribute 'form_for_instance'

2007-03-02 Thread Benedict Verheyen
stevelewis schreef: > So I've developed on my laptop, and am trying to deploy to a unix box, > and most things work fine, but I'm using the newforms form for > instance method, and it can't find it: > > 'module' object has no attribute 'form_for_instance' > > It appears to be there, but I'm not

change save url of imagefield

2007-03-05 Thread Benedict Verheyen
Hi, i have a class with an imagefield. I'm trying to add the current logged in user to the path where the image field is saved. image = models.ImageField(upload_to="img/_USER_/icons/", blank=True ) _USER_ is a placeholder for the "real" user. def add_icon(request): IconForm = forms.models.f

Re: change save url of imagefield

2007-03-05 Thread Benedict Verheyen
Jarosław Świerad schreef: > On Monday 05 March 2007 09:42, Benedict Verheyen wrote: >> Hi, >> >> i have a class with an imagefield. >> I'm trying to add the current logged in user to the path where the image >> field is saved. >> image = models.ImageFie

Re: Be sure filenames are unique in imagefield

2007-03-15 Thread Benedict Verheyen
Michel Thadeu Sabchuk schreef: > Hi guys, > > I want to be able to add a images with same filename but I don't want > to replace old images when I repeat a name. Suppose I will add a > object with an image field and the filename is image.jpg, I want to be > able to add another object with another

validating using newforms

2007-03-16 Thread Benedict Verheyen
Hi, i have a model (using newforms) where i have an image upload field. Now i'm trying to check the image dimensions amongst other things. I thought i could do this using validators. It doesn't seem to call the validator specified in the model though. How can i validate data? def validate_image

Re: validating using newforms

2007-03-16 Thread Benedict Verheyen
Rubic schreef: > Benedict, > > You add a clean_XXX method to your form class, > where XXX corresponds to the field name you wish > to validate. > > In your clean_XXX method, you return > self.clean_data['XXX'] if your data validates, > otherwise raise a ValidationError exception. > > I just po

Re: Outputting a default value for my TextField custom form manipulator html input ...

2007-03-16 Thread Benedict Verheyen
dbee schreef: > I'm trying to output an account form, with the user's values already > in place. So that if they wish to change any value, they can just > change the > I'm using .95 with oldforms, and I can't seem to find anyway of > outputting a default value with my form. That's a serious prob

Re: upload_to with username

2007-04-06 Thread Benedict Verheyen
Stephen Mizell schreef: >> That line is executed exactly once, at the time the file is imported. So >> it is not dynamic in any way. >> >> (I seem to be saying that at least every other day here. It's normal >> Python behaviour, people. Please stop hoping it were otherwise!) > > Thanks for the he

sort values in a drop down

2007-04-10 Thread Benedict Verheyen
Hi, i have an application that uses oldforms. A model has a foreignkey to a Patients model. Now the users want the patients to be sorted by roomnumber. The roomnumber is specified in another model called room. I have a custome Manipulator so i thought i could change the fields that are shown in

Re: sort values in a drop down SOLVED

2007-04-11 Thread Benedict Verheyen
Benedict Verheyen schreef: > class ScoreAddManipulator(Score.AddManipulator): > default = {} > > def __init__(self): > # Construct the fields and set the values in default > Score.AddManipulator.__init__(self) > ScoreAddManipul

unknown encoding cp0

2007-09-19 Thread Benedict Verheyen
Hi, a while back i updated my python isntall to version 2.5.1. on a Windows 2000 server. It also runs Apache 2.2 & mod_python for Django. Since the python upgrade, i got this "unknown encoding cp0" error. I hadn't changed anything to the code. The errors always occured on print commands. I foun

Re: unknown encoding cp0

2007-09-19 Thread Benedict Verheyen
equest, *args, **kwargs) File "E:\Sites\sitesdjango\user_creation\main\views.py" in user_creatie 50. u.create_all() File "E:\Sites\sitesdjango\user_creation\packages\user\user_creation.py" in create_all 48. self.report() File "E:\Sites\sitesdjango\user_creation\

Re: unknown encoding cp0 (occurs only after Unicode branch merge, >r5600)

2007-09-20 Thread Benedict Verheyen
Benedict Verheyen schreef: > Nis Jørgensen schreef: > > >>> >> What is "self" referring to? Can you give us a stack trace? And which >> version of Django are you running (it is especially important to know if >> it is before or after the u

admin page doesn't show tables when models.py is in the project dir

2006-09-20 Thread Benedict Verheyen
Hi,i started a project and since i don't have any 'apps' for that project i decided toadd the models.py to the main project directory so next to settings.py.I added the main project directory to the INSTALLED_APPS in settings.py and python manage.py syncdb ran ok.The tables are made and via python

Re: [SOLVED] admin page doesn't show tables when models.py is in the project dir

2006-09-20 Thread Benedict Verheyen
Found it, i forgot to add this to the models:    class Admin:    passSolved now,Thanks,Benedict --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

automatically fill in some fields of a form, storing authenticated user

2006-09-22 Thread Benedict Verheyen
I'm not sure how to do those tasks:1. For a model, i want to allow the user to import settings from anotherdatabase. For instance, they fill in a number and hit a link or button,then data is looked up in another database and some of these values are then filled in the form so that when the user cre

Re: automatically fill in some fields of a form, storing authenticated user

2006-09-26 Thread Benedict Verheyen
Thanks Andres, quite interesting. The way i solved it was based on parts of the wiki and loads of trial and error. I made a class that simplifies using custom Manipulators and then derived a specific class for adding a Patient (model i'm using) where i initialise the derived class by calling th

sorting data on list pages, date validation

2006-09-28 Thread Benedict Verheyen
HI, i have a few questions. 1. In my app, i have a list view where several fields are represented in tables. Now i want the user to be able to click the columnheader in order to sort the data. I have javascript code that displays a + or - wether (toggling between the 2) and i made 2 views, 1 fo

sorting data on list pages, date validator

2006-09-28 Thread Benedict Verheyen
Hi, i have a few questions. 1. In my app, i have a list view where several fields are represented in tables. Now i want the user to be able to click the columnheader in order to sort the data. I have javascript code that displays a + or - wether (toggling between the 2) and i made 2 views, 1 fo

sorting data on a list page, date validator

2006-09-28 Thread Benedict Verheyen
Hi, i have a few questions. 1. In my app, i have a list view where several fields are represented in tables. Now i want the user to be able to click the columnheader in order to sort the data. I have javascript code that displays a + or - wether (toggling between the 2) and i made 2 views, 1 fo

RE: sorting data on list pages, date validation

2006-09-28 Thread Benedict Verheyen
input and output date formats are supported now (NEW) i highly recomend it - Original Message From: Benedict Verheyen <[EMAIL PROTECTED]>To: django-users@googlegroups.comSent: Thursday, September 28, 2006 1:06:51 PMSubject: sorting data on list pages, date validation HI,i

datetime conversion in a ChangeManipulator doesn't work anymore on save

2006-10-10 Thread Benedict Verheyen
Hi, here we use dates as dd/mm/. Therefore, i have to use custom manipulators to add and change objects. What i do is this. If the user clicks on an objectline to change the record, the ChangeManipulator will format the dates the way i want and display them. On submitting the form, the dates

Re: datetime conversion in a ChangeManipulator doesn't work anymore on save

2006-10-10 Thread Benedict Verheyen
Benedict Verheyen schreef: > == ChangeManipulator == > class TeamverslagChangeManipulator(Teamverslag.ChangeManipulator, > CustomManipulator): > default = {} > done = False > > def __init__(self,object_id): >

limit choices of records of a ForeignKey field

2006-10-12 Thread Benedict Verheyen
Hi, i have a model "Patient" that has a field active. Active = True by default. If the users want to delete a patient, they actually want to first deactivate the patient meaning setting the active field to False. All lists and records that link to this patient model should only display patients

Re: limit choices of records of a ForeignKey field

2006-10-12 Thread Benedict Verheyen
Benedict Verheyen schreef: I found a solution in the "limited_choices_to" argument of the ForeignKey function. I get the results i want by specifiying this: patient = models.ForeignKey(Patient, null=False, limit_choices_to = {'actief':True}) instead of patient = models.Fore

increase size of a charfield

2006-10-25 Thread Benedict Verheyen
Hi, a have a charfield of 255 chars in a model but on the form, it consists of a smallish inputfield instead of a textarea. How can i increase the size of the form element? Thanks Benedict --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: increase size of a charfield

2006-10-26 Thread Benedict Verheyen
Benedict Verheyen schreef: > Hi, > > a have a charfield of 255 chars in a model but on the form, it > consists of a smallish > inputfield instead of a textarea. > How can i increase the size of the form element? > > Thanks > Benedict The solution with changing th

Re: increase size of a charfield

2006-10-26 Thread Benedict Verheyen
Malcolm Tredinnick schreef: >> >> In general, we want like to avoid putting presentation related >> information into models, since they should be presentation independent >> as much as possible. The fact that we haven't avoided that entirely so >> far isn't an excuse to slide further down that slo

Re: increase size of a charfield

2006-10-29 Thread Benedict Verheyen
RajeshD schreef: > Here's one solution: > > When you write out your textarea, encapsulate it in a div element with > a class attribute. For example, > > {{form.address}} > > or > > {{form.address}} > > and so on. > > Then, in your stylesheet, you can target those specific textarea > elements

almost got django app to work on apache 2.2 and mod_python

2006-11-14 Thread Benedict Verheyen
Hi, After developing my app, i want to serve it from apache. Apache & mod_python work but my app doesn't behave like it should. Probably a urls.py error? I searched the archive but haven't been able to solve it. It seems to find my settings (judging from the params displayed on the error page) b

Re: almost got django app to work on apache 2.2 and mod_python

2006-11-14 Thread Benedict Verheyen
Benedict Verheyen schreef: I was able to remove the settings.py, manage.py and urls.py from the D:\sitesdjango\ directory by correctly using a .pth file in site-packages. The content of the gema.pth file is set to D:\sitesdjango\gema But then all the don't work and the layout is gone. Any

Re: SOLVED almost got django app to work on apache 2.2 and mod_python

2006-11-15 Thread Benedict Verheyen
I solved it by just starting over with copying my project from the development dir to the server dir. Then i fiddled with the pythonpath and got it to work. I added the personal notes i took when solving the issue. Mind that sometimes there might not be lot's of info but as i said, these are my p

  1   2   >