Django 1.8 add created_by when upload image in admin

2016-02-25 Thread gerard
Hello all, I'm trying to add the user when upload a file using the admin in Django. The model is: class Image(models.Model): image = models.FileField(upload_to=DIR_IMAGES, max_length=500) created_by = models.ForeignKey(User, related_name='created_by', editable=False) in admin.py, i

Re: EmailField: unable to make it mandatory?

2016-01-04 Thread gerard
Le 04/01/2016 08:55, James Schneider a écrit : On Jan 3, 2016 9:02 PM, "gerard" <gh224...@gmail.com <mailto:gh224...@gmail.com>> wrote: > > Hello all and happy new year, > > with Django 1.7, i have this model: > class Subscription(models.Model): >

EmailField: unable to make it mandatory?

2016-01-03 Thread gerard
Hello all and happy new year, with Django 1.7, i have this model: class Subscription(models.Model): email = models.EmailField(max_length=75) created_by = models.ForeignKey(User) sub = Subscription.objects.create(created_by=self.user) this does not product an error due to email missing.

exception "myapp.models.DoesNotExist" instead of "MyModel.DoesNotExist"

2015-10-06 Thread gerard
Hello all, i use Django 1.8.4 with sqlite. I added a simple model into "catalogue" app: class Zoom(models.Model): name = models.CharField(max_length=200) def __str__(self): name = "%s" % self.name return name and dit manage.py makemigrations/migrate. I have a code like

Re: django-sendfile with apache2+mod_wsgi: got empty files

2015-09-16 Thread gerard
Le 16/09/2015 15:47, gerard a écrit : In apache2 conf: Options Indexes FollowSymLinks MultiViews XSendFile On AllowOverride All Order allow,deny allow from all ok, replacing the above with: XSendFile On XSendFilePath /home/devel/media/python3/media/Images/ does

django-sendfile with apache2+mod_wsgi: got empty files

2015-09-16 Thread gerard
Hello all, im using django-sendfile with django 1.8.4. Tested with development backend and runserver, everything is fine. But when going to Apache2 and xsendfile backend, the downloaded files are empties, i don't understand why. I have: MEDIA_ROOT = '/home/devel/media/python3/media' and

django 1.8 + mysql + python 3.2

2015-07-21 Thread gerard
Hello all, I have this combination, on debian 7 (in openvz, not possible to upgrade). According https://docs.djangoproject.com/en/1.8/ref/databases/#mysql-db-api-drivers, i have to use mysqlclient or MySQL Connector/Python provided by Oracle. Unfortunately, mysqlclient failed to work: File

Re: unable to create translation files

2014-12-10 Thread gerard
Le 10/12/2014 16:02, Tom Evans a écrit : "python manage.py makemessages --settings=agenda.settings" I suspect the difference is between running manage.py and running django-admin.py - manage.py might add the directory containing it to sys.path. you're right: $ python manage.py makemessages

unable to create translation files

2014-12-10 Thread gerard
hello all, i'm using Django 1.4 LTS, and try to add localisation to my project. According the doc: https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#localization-how-to-create-language-files i have to do: django-admin.py makemessages --all i did it and have the error:

different urls

2014-11-09 Thread gerard
Hello all, i have an application (Django 1.4 LTS) that can be accessed with 2 urls: the default is https://my.app.org and the second is http://consult.my.app.org In the templates, i'm using: {% trans "Connect to see more features" %} and it's displayed as https://my.app.org/accounts/login if

problem with a date between a form and database

2014-09-18 Thread gerard
hello all, i have a form to get a date. But when i get object from the database, the database is not as expected, user type "18/09/2015", but after savin, i got: 17/09/2015 22:00 here is the code: #settings.py TIME_ZONE = 'Europe/Paris' #models.py class MyEvent(models.Model): dtstart =

Re: Please wait page

2010-08-23 Thread Gerard Flanagan
Bradley Hintze wrote: Hi all, My webpage has a process that takes about 10-15 seconds. Is there a way I can have an intermediate 'Please wait' page, preferably with blinking shapes (dots) so that the user knows that the process is still working. As an example try finding a flight at

Re: Django architecture question

2010-06-15 Thread Gerard JP
is to make sure you don't have name clashes). Hope it helps. Regards, Gerard. On Jun 15, 6:55 am, Joel Klabo <joelkl...@gmail.com> wrote: > I am working on a simple site right now and the views are pretty easy. > Usually just iterate a loop of objects. But, I am trying to figure out >

Consequences of a force_update

2009-10-27 Thread Gerard
reason. Looking at the code, a "force_update=True" seems to take this action out of the loop. Can somebody tell me why this is done, and whether suppressing it has consequences? Thanx a lot. Regards, Gerard. -- self.url = www.ge

Re: object.save() executes a .filter() somewhere

2009-10-27 Thread Gerard
It works when I disable "use_for_related_fields = True". Would it be safe to disable this and simply manage the reverses myself? Regards, Gerard. PS: Sorry for the spam :) Gerard wrote: > Looking at the trace, the filter executed without a user is this one: > > File

Re: object.save() executes a .filter() somewhere

2009-10-27 Thread Gerard
s like I'm diving into a rabbit hole that is way to deep. Help or tips are much appreciated. Gerard. Gerard wrote: > Hi all, > > I'm totally in the dark atm. I save an object in the following way: > > if form.is_valid(): > order = form.save(commit=False) >

object.save() executes a .filter() somewhere

2009-10-27 Thread Gerard
can I tell it to give an owner parameter or to use my 'true_filter()' Please advice. Thanx a lot. Regards, Gerard. -- self.url = www.gerardjp.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Re: Login over HTTPS

2009-10-27 Thread Gerard
webserver in front of the app rewriting/redirecting the /login /logout (as an example) requests to https. And leaving the 'after login redirect' after logging in alone, and thus being back on regular http. Regards, Gerard. Jani Tiainen wrote: > Technically yes. > > From psychologi

Re: Login over HTTPS

2009-10-27 Thread Gerard
I do want to implement that myself. Lets post if we find anything :) Regards, Gerard. Jani Tiainen wrote: > I'm trying to get Django to make authentication (namely username + > password) to be transferred over HTTPS. But rest of the site is still on > plain old HTTP. > > How th

Re: Do reverse relations eventually kill performance?

2009-10-27 Thread Gerard
/django-queryscreener-a-record-level-ownership-development-auditor/ :) Thanx again. Gerard. Manfre wrote: > Subclass Manager and make this the default manager for all owner > restricted models. Override filter() and get() to check for the > "owner" arg. Raise an error if it is not

Re: Do reverse relations eventually kill performance?

2009-10-25 Thread Gerard
evelopment. Would that be afeasible option? Thanx, Regards, Gerard. Tim Chase wrote: > Gerard wrote: >> Hi all, >> >> I'm working on a safe way to get users to only see there own records. I've >> been working on subclassing model.Manager and requiring a 'owner' parm fo

Do reverse relations eventually kill performance?

2009-10-25 Thread Gerard
now I can still choose how to set things up without refactoring my codebase. Thanx a lot. Regards, Gerard. -- self.url = www.gerardjp.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&q

Re: Queryset inspection in models.Manager not possible without breaking

2009-10-23 Thread Gerard
do hope though that you give me some pointers as to multi-user setups. Thanx a lot. Kind regards, Gerard. Matías Costa wrote: > On Fri, Oct 23, 2009 at 9:25 AM, Gerard <lijss...@gp-net.nl> wrote: >> Hi All, >> >> I'm trying to find a way to filter on a certain

Queryset inspection in models.Manager not possible without breaking

2009-10-23 Thread Gerard
ple seeing confidential information. I have two questions. - Why doesn't the queryset inspection work as I intented? - Where else could I force such a requirement in a generic way? Thanx a lot. Gerard. -- self.url = www.gerardjp.com --~--~-~--~~~---~--~~ You recei

Re: Please help: {% url ... %} path resolve issue

2009-10-17 Thread Gerard
. Kind regards, Gerard. David Paccoud wrote: > Hi Gerard, > > Views and not found by the template loader but the the PYTONPATH.. > For "project.myapp.views.customer_edit", it finds a project package in > your PYTHONPATH and follow the path up to "custome

Re: Please help: {% url ... %} path resolve issue

2009-10-17 Thread Gerard
duct/(?P\d+)/edit$', 'product_edit', name='product_edit'), (r'^product/(?P\d+)/delete$', 'product_delete', name='product_delete'), Last two parms are equal for all entries. Nevertheless thanks. Regards, Gerard. David Paccoud wrote: > Hi, > > You can use {% url customer_edit

Re: Please help: {% url ... %} path resolve issue

2009-10-17 Thread Gerard
Hi Thierry, The actual url used (and working) is: http://192.168.1.81:8000/customer/2/edit Without the end slash. Gerard. Thierry wrote: > Hi, > > Could it be that you are missing trailing slashes in customer add/edit/ > delete url patterns? > E.g try: > (r'^cus

Re: Please help: {% url ... %} path resolve issue

2009-10-17 Thread Gerard
'), -- snip -- (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), ) Thanx a lot. Regards, Gerard. boyombo wrote: > Hi Gerard, > > can you what is your url conf like and the error message you get? > > On Oct 17, 1

Please help: {% url ... %} path resolve issue

2009-10-17 Thread Gerard
(?) where to look for views? Feels like it just needs an import statement on the right place. NB: I tried passing views in patterns as strings and methods. Please advice. Kind regards, Gerard. -- self.url = www.gerardjp.com --~--~-~--~~~---~--~~ You received

Re: Good News !! A mate found for your dog ...

2009-10-16 Thread Gerard
Ik think it's .. My dog ate the website :) ?? ? wrote: > It's the dog. The dog is the one who uses Django. All the time. > > On Fri, Oct 16, 2009 at 9:18 PM, jc > wrote: > > > Finally. I wonder if their site uses django? > > On

DRY: max length not taken from Model.field when using ModelForm

2009-10-15 Thread Gerard
to put this? It does seem to work for the form fields' label, which is taken from the model fields' verbose name. Thanx for any light on the subject Regards, Gerard. -- self.url = www.gerardjp.com --~--~-~--~~~---~--~~ You received this message because you

Re: how to design mobile version of my site based on django?

2009-10-10 Thread Gerard
. Might want to look at: http://code.google.com/p/minidetector/ Regards, Gerard. hao he wrote: > I'm developing my site with django, > > mainly, my site works as normal, visited by PC. > > but ,the site will also be visited by mobile device(e.g.iphone) > > who

Re: How to make fields mandatory for User

2009-10-09 Thread Gerard
Think I'll go with the form option .. Just finished the User (profile) extention thing with a 1to1 instead of subclassing User :) Thanx for the feedback! Gerard. Bayuadji wrote: > Hi Gerard, > > On 10/9/09, Gerard <lijss...@gp-net.nl> wrote: >> Hi all, >> >

How to make fields mandatory for User

2009-10-09 Thread Gerard
Hi all, I need the fields first_name and last_name of Django's User object to be mandatory when creating users via the Admin interface. Is there an easy way to do this? Thanx, Gerard. -- self.url = www.gerardjp.com --~--~-~--~~~---~--~~ You received

SOLVED - Re: User object subclass appears in App models under Admin instead of Auth

2009-10-08 Thread Gerard
, if you dig up the same issue :) Regards, Gerard. Gerard wrote: > Found a solution that's getting me closer to my goal > > http://www.thenestedfloat.com/articles/displaying-custom-user-profile-fields-in-djangos-admin > > Regards, > > Gerard. > > Gerard wrote: >&

Re: User object subclass appears in App models under Admin instead of Auth

2009-10-08 Thread Gerard
Found a solution that's getting me closer to my goal http://www.thenestedfloat.com/articles/displaying-custom-user-profile-fields-in-djangos-admin Regards, Gerard. Gerard wrote: > Hi all, > > I've subclassed Django's User object (also accessible under Admin) to extend > the

User object subclass appears in App models under Admin instead of Auth

2009-10-08 Thread Gerard
this be possible? And when using the admins passwd change dialog "change password form." it returns an error: Warning at /admin/myapp/userprofile/4/password/ Truncated incorrect DOUBLE value: '4/password' Anybody seen this before? Thanx a lot. Regards, Gerard. Reference: http://scottb

Re: No distinction on user status on form.is_valid() when using AuthenticationForm

2009-10-05 Thread Gerard
Must have missed that somehow. Thanx Karen. Regards, Gerard. Karen Tracey wrote: > On Mon, Oct 5, 2009 at 6:46 AM, Gerard <lijss...@gp-net.nl > <mailto:lijss...@gp-net.nl>> wrote: > > > Hi All, > > When checking form validity with > >

No distinction on user status on form.is_valid() when using AuthenticationForm

2009-10-05 Thread Gerard
Hi All, When checking form validity with form.is_valid() after form = AuthenticationForm(data=request.POST) I get a False when the user is set to inactive. One would think a form can be valid besides a user being disabled. The reason, I want a seperate error messages for

Re: Best practice on data security .. on record, table (model) db or url

2009-08-23 Thread Gerard
some handson experience first I might *bump* this message again later. Regards, Gerard. Sam Lai wrote: > 2009/8/21 Gerard <lijss...@gp-net.nl>: >> Hi All, >> >> I'm working on an invoice system, currently deployed the single user version >> in house. Next one is

Best practice on data security .. on record, table (model) db or url

2009-08-21 Thread Gerard
of the websites' layout. Thanx a lot! Kind regards, Gerard. -- self.url = www.gerardjp.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: Django Testing

2009-08-20 Thread Gerard
same data setup for all tests you can also place them in your setUp/tearDown methods. Regards, Gerard. Vitaly Babiy wrote: > I been working on a django project for some time and I keep running in > to the problem that fixtures are just to fragile, I was wondering if > anyone had

Admin site statics (CSS) seen via 'runserver' not via fcgi

2009-08-17 Thread Gerard
shine some light on my blind spot :) Thanx a lot Kind regards, Gerard. -- self.url = www.gerardjp.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: table display with AJAX

2009-02-07 Thread Gerard Flanagan
MrJogo wrote: > Hi, > > One of my pages is going to have a table that I'd like to be sortable, > and I'm wondering the best way to do this. I looked into django- > tables, which seems good, but once the page is loaded, I'd also like > to be able to sort dynamically (using javascript). Before I

Re: Read/Create Excel xls files using django

2008-11-13 Thread Gerard flanagan
Kurczak wrote: > On 13 Lis, 20:45, dj <[EMAIL PROTECTED]> wrote: >> Hello All, >> >> I am trying to detemine if there is a way to read the data from an >> Excel xls file into django. I also need to create an xls file. Does >> anyone know how that would be done ? > If you have windows hosting you

Re: Problem with named URL and parameters

2008-11-13 Thread Gerard flanagan
Brandon Taylor wrote: > Hi everyone, > > So I have a question/problem with a named URL pattern... > > #urls.py > url(r'^resources/conversions/(?P[-\w]+)/$', > 'my_site.views.conversions', name='conversions'), > > This is a mostly static site, but I would like to be able to pass the >

Re: model inheritance - getting data from child objects

2008-11-07 Thread Gerard flanagan
Alistair Marshall wrote: > As I said, I have the function named the same in each child class but > I need to be able to access it from a list of all the Places. > > My current thinking is just a long list of try, except: statements > attempting to call the subclass from the Place model but this

[solved] Custom include tag to parse locale into filename

2008-10-24 Thread Gerard Petersen
if path[0] in ('"', "'") and path[-1] == path[0]: return ConstantIncludeNode(path[1:-1]) return IncludeNode(bits[1]) register.tag('my18n_include')(do_i18n_include) Note: there's no fallback yet to a default for none existent locale files. Regards, Gerard. Gerard

Custom include tag to parse locale into filename

2008-10-23 Thread Gerard Petersen
myapp/customer_side.html" %} I'm thinking about a custom templatetag that picks up on the locale. Does anybody have other suggestions on how to do this? Thanx a lot. Regards, Gerard. -- urls = { 'fun': 'www.zonderbroodje.nl', 'tech': 'www

Re: What do you use for design interface / mockup

2008-10-23 Thread Gerard Petersen
). Regards, Gerard. Francis wrote: > Hi, > > What do you use for design interface / mockup? > > I made some search, omnigraph seems pretty popular. But I often switch > between linux and Mac and omnigraffle isn't cross platform. > > Is there any tools out there that wo

Re: Disable i18n for certain templates

2008-10-23 Thread Gerard Petersen
The answer to the Q in the subject would be not to use the {% trans .. %} or {% load i18n %} tags in your template .. :) Armandas wrote: > Hi, > > I am using internationalization on my project. Recently I found out > that output from date filter is not in english. The point is, that I > use

Re: Disable i18n for certain templates

2008-10-23 Thread Gerard Petersen
-ish object or string. Regards, Gerard. Armandas wrote: > Hi, > > I am using internationalization on my project. Recently I found out > that output from date filter is not in english. The point is, that I > use this to construct pubDate for my rss, like this: > > {{ post.date

Re: Highlight current active page

2008-10-14 Thread Gerard Petersen
/ And so the relation is: base.html > base_order.html > order_detail.html Resulting in this: http://paste.pocoo.org/show/87938/ Then in your CSS file you can give the active li a different color. Hope it helps! Regards, Gerard. Alex Rades wrote: > Hi Gerard, > sorry but I don't und

Re: Which IDE do you choose with django?

2008-10-12 Thread Gerard Petersen
My personal favorite is "Editra" Regards, Gerard. zjffdu wrote: > I am a newbie of django, and want to know which IDE is suit for > django? > > thank your > > -- urls = { 'fun': 'www.zonderbroodje.nl', 'tech': 'www.gp-net.nl' } --~--~-~--~~-

Re: Blank and null values for a foreign key

2008-10-12 Thread Gerard Petersen
) class License(models.Model): person = models.ForeignKey(Person) number = models.IntegerField(max_length=10) Regards, Gerard. Fabio Natali wrote: > Hi all! > > I have two models, Person and License. > > class License(models.Model): > number = models.IntegerF

Re: djangosnippets.org list navigation

2008-10-10 Thread Gerard Petersen
You can simply add this to your keywords in google (and thus use google): site:www.djangosnippets.org End result: http://www.google.nl/search?q=site%3Awww.djangosnippets.org+state Regards, Gerard. David Durham, Jr. wrote: > The list navigation on djangosnippets is not so good. T

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Gerard Petersen
Dan, I know a workaround which is this: django_admin = __import__('django-admin', fromlist=['django.bin']) But I'm not into Django's code enough to know how it is generally done. Regards, Gerard. Dan Ellis wrote: > On Oct 8, 11:22 am, Malcolm Tredinnick <[EMAIL PROTECTED]>

Re: Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Gerard Petersen
only do a checkout of let's say the branch you're working on instead of the 'full tree' with trunks, tags and branches? Thanx again guys!! Gerard. Gerard Petersen wrote: > Hi all, > > This might be somewhat off topic, but I'm moving my django project into > another directory

Branching proj/myapp into branch/0.1/myapp breaks

2008-10-08 Thread Gerard Petersen
Hi all, This might be somewhat off topic, but I'm moving my django project into another directory (svn branch). It was here: /home/gerard/files/python/djapp/(myapp) I want it here: /home/gerard/files/python/djapp/branches/0.1/(myapp) When the project dir is named 0.1 instead of djapp I get

(newb) ImportError in script but not in interactive shell

2008-10-06 Thread Gerard flanagan
Hello, I have a utility script 'load_data.py' that primes a database with dummy data via the application Models. It sits in my project root directory: myproj/ settings.py manage.py load_data.py ... myapp/ ... When I do 'python manage.py

Re: (newb) ImportError in script but not in interactive shell

2008-10-06 Thread Gerard flanagan
Karen > Ah, obvious really! I thought there was some magic involved. Thanks for the help. Gerard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send emai

Re: Q about a ticket and merging into svn

2008-10-04 Thread Gerard Petersen
not offer more then testing and or writing docs. Thanx again guys! Regards, Gerard. Russell Keith-Magee wrote: > On Fri, Oct 3, 2008 at 5:13 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote: >> I examined the svn tree and the patches. It seems that the diffs are for the >>

Re: Q about a ticket and merging into svn

2008-10-03 Thread Gerard Petersen
code ... ;-) any reading in regards to Django how this is setup? Thanx a lot! Regards, Gerard. Russell Keith-Magee wrote: > On Thu, Oct 2, 2008 at 7:00 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote: >> Hi all, >> >> I'm in need of the functionality of ticket #3

Re: Q about a ticket and merging into svn

2008-10-02 Thread Gerard Petersen
Russell, Thanx for the heads up. I've been using svn for a while, but it seems like I indeed need to brush on svn and patching. Mind you, in daily work my 'system/network administration' hat is bigger then my 'software development' hat. Anyway, thanx again! Regards, Gerard. Russell Keith

Q about a ticket and merging into svn

2008-10-02 Thread Gerard Petersen
Hi all, I'm in need of the functionality of ticket #3672. I have de initial code implemented. And there are some patches, but they seem to be diffs on files in the main svn trunk. The question with the easiest solution for me would be, when is the code from this ticket going to be merged

Re: Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
'), 'billed': _('Billed'), 'paid': _('Paid') } This way I can access the states as usual, and have the related translation displayed. Regards, Gerard. Carl Meyer wrote: > On Sep 30, 2:58 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote: >> It is indeed stored, I'm using

Re: Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
order.bill() and order.is_billed() If not, please clearify. Thanx a lot. Regards, Gerard. Carl Meyer wrote: > On Sep 30, 2:58 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote: >> It is indeed stored, I'm using a state machine >> (http://www.djangosnippets.org/snippets/737/). Setting

Re: Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
for control) also have a meaning to the user displayed in the template. So I would want to translate them at the last moment, and not store them as such. Regards, Gerard. Kenneth Gonsalves wrote: > On Tuesday 30 September 2008 10:40:15 am Gerard Petersen wrote: >> #~ msgid "quoted"

Re: display of datefield breaks admin template

2008-09-30 Thread Gerard Petersen
e on how a datefield contents then would be correctly presented in a form when the format deviates from how it's stored in a mySQL database? Thanx! Gerard. Carl Meyer wrote: > On Sep 30, 7:29 am, Gerard Petersen <[EMAIL PROTECTED]> wrote: >> I get this trace:http://paste.pocoo.org/

Translation of object.attribute in template

2008-09-30 Thread Gerard Petersen
performed there data-wise, I really don't want it there. Anybody have any experience on this? Thanx a lot. Gerard. -- urls = { 'fun': 'www.zonderbroodje.nl', 'tech': 'www.gp-net.nl' } --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: HTTPS Question...

2008-09-30 Thread Gerard Petersen
performance issues are not in sight until you reach 1000's of hits (or more) a sec. Hope it helps. Regards, Gerard. [EMAIL PROTECTED] wrote: > We have an online application for school, where we request the > individuals SSN and PharmCAS information. The application will be at > say www.ou

Re: Highlight current active page

2008-09-30 Thread Gerard Petersen
Steven, Sorry, I replied to the wrong message in this thread. Your setup is actually quite charming. Regards, Gerard. Steven Armstrong wrote: > Alex Rades wrote on 09/30/08 09:03: >> Hi, >> what kind of pattern do you use to add a class attribute to the >> current pa

Re: Highlight current active page

2008-09-30 Thread Gerard Petersen
e.html etc ... This comes straight from the docs: http://docs.djangoproject.com/en/dev/topics/templates/#id1 (See 'base_SECTIONNAME.html' about two screens down from there) I personally dont' see the needs for loops and extra code. Or is my app to simple ... :-) Regards, Gerard.

display of datefield breaks admin template

2008-09-30 Thread Gerard Petersen
, Gerard. -- urls = { 'fun': 'www.zonderbroodje.nl', 'tech': 'www.gp-net.nl' } --~--~-~--~~~---~--~~ 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@google

Re: Suggested approach for a date based form layout

2008-09-29 Thread Gerard Petersen
Nick, I'm not a longtime Django user, but I would check de django docs on "modelform". That covers all my needs. Mvrgr, Gerard. Nick Lo wrote: > Hello, > > I'm working on a series of forms that need to look something like the > following with days of the mo

Re: blank vs. exclude

2008-09-29 Thread Gerard Petersen
/editable options set in the model itself. Regards, Gerard. johnny wrote: > I have a question about the exclude property in ModelForm. When I > have a Model and the ModelForm for it excludes a field from that > Model, shouldn't the ModelForm validation excludes that field as well? >

Re: admin.site.register breaks unittests

2008-09-28 Thread Gerard Petersen
che vhost or location directive anyway? I'll stop with the questions now ... rtfm and all that ... ;-) Thanx again. Regards, Gerard. > > Yours, > Russ Magee %-) > > > -- urls = { 'fun': 'www.zonderbroodje.nl', 'tech': 'www.gp-net.nl' } --~--~-~--~~---

Re: admin.site.register breaks unittests

2008-09-28 Thread Gerard Petersen
ns nothing. Thanx a lot for your effort. Regards, Gerard. Russell Keith-Magee wrote: > On Sat, Sep 27, 2008 at 9:54 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote: >> Russel, >> >> The example from the docs somehow doesn't work. I've turned on the >> autodisco

Re: forms.DecimalField ... min_value=0.01 not honored

2008-09-28 Thread Gerard Petersen
Malcom, This seems so obvious, I'm working on an invoice system and already passed the chapter on rounding decimals. I still am somewhat overwhelmed I guess by all that Django does. Nevertheless, it's impressive how good Django keeps to (python) conventions. Thanx a lot. Regards, Gerard

forms.DecimalField ... min_value=0.01 not honored

2008-09-27 Thread Gerard Petersen
a new ticket before being sure. I'm a correct? Regards, Gerard. -- urls = { 'fun': 'www.zonderbroodje.nl', 'tech': 'www.gp-net.nl' } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: admin.site.register breaks unittests

2008-09-27 Thread Gerard Petersen
Russel, The example from the docs somehow doesn't work. I've turned on the autodiscover but under admin it stays empty. I don't know if this is related, but putting the register statements in urls.py does stop breaking my tests. Regards, Gerard. Russell Keith-Magee wrote: > On Sat, Sep

Re: Why/where are field errors caught before form.is_valid is executed

2008-09-27 Thread Gerard Petersen
,) def __init__(self, *args, **kwargs): super(ProductForm, self).__init__(*args, **kwargs) # By this one!!! self.fields['description'].max_length = 2 Still would like a regex based check in the declarative one. Anybody done this before? Thanx n greetz Gerard. Gerard

Why/where are field errors caught before form.is_valid is executed

2008-09-27 Thread Gerard Petersen
t like I'm inventing the wheel here. Thanx a lot for any pointers. Gerard. -- urls = { 'fun': 'www.zonderbroodje.nl', 'tech': 'www.gp-net.nl' } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja

admin.site.register breaks unittests

2008-09-26 Thread Gerard Petersen
am I misssing? Thanx! Gerard. -- urls = { 'fun': 'www.zonderbroodje.nl', 'tech': 'www.gp-net.nl' } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Update: Date formatting between model and form output

2008-09-26 Thread Gerard Petersen
Found an error in the model code. It should be this: if isinstance(self.period_start_date, datetime): Regards, Gerard, koenb wrote: > On 26 sep, 16:00, Gerard Petersen <[EMAIL PROTECTED]> wrote: >> Getting closer. This works: product.period_start_date.strftime('%d-%m-%

Re: Update: Date formatting between model and form output

2008-09-26 Thread Gerard Petersen
. Regards, Gerard. koenb wrote: > On 26 sep, 16:00, Gerard Petersen <[EMAIL PROTECTED]> wrote: >> Getting closer. This works: product.period_start_date.strftime('%d-%m-%Y') >> >> But I definitely do not want this in all view handlers. It should go in the >> model .. or

Update: Date formatting between model and form output

2008-09-26 Thread Gerard Petersen
Getting closer. This works: product.period_start_date.strftime('%d-%m-%Y') But I definitely do not want this in all view handlers. It should go in the model .. or the modelform. Thanx again! Gerard. Gerard Petersen wrote: > Hi all, > > I'm trying to have a formfie

Date formatting between model and form output

2008-09-26 Thread Gerard Petersen
e sequence is almost complete. But where do I format the value so the formfield shows the correct formatted value when editing. In the model, the form or the view method? Thanx a lot. Gerard. -- urls = { 'fun': 'www.zonderbroodje.nl', 'te

Re: Query

2008-09-25 Thread Gerard Petersen
. But there's more information to digest before you have working functionality. I'd look at the django tutorial: http://docs.djangoproject.com/en/dev/intro/tutorial01/ And ask yourself if you want to expand your described functionality in the future. Hope it helps. Regards, Gerard. ANURAG BAGARIA

Re: Concept Q: Extra model fields for clean templates sake

2008-09-25 Thread Gerard Petersen
Brian, Now that I read it ... so obvious. I've come from a long history of procedural coding. So I understand OOP but don't take full advantage of it yet ... obviously .. :-) Thanx and Greetz! Gerard. Brian Neal wrote: > On Sep 25, 4:33 am, Gerard Petersen <[EMAIL PROTECTED]> wro

Re: Concept Q: Extra model fields for clean templates sake

2008-09-25 Thread Gerard Petersen
but in the future I want to be able to generate them in pdf or ms word as well. So doing the work in the view seems like easier transition to those filetypes in the future. Regards, Gerard. Daniel Roseman wrote: > On Sep 25, 10:33 am, Gerard Petersen <[EMAIL PROTECTED]> wrote: >> Hi

Concept Q: Extra model fields for clean templates sake

2008-09-25 Thread Gerard Petersen
, Gerard. Some source snippets if it's not clear: # Model class Product(models.Model): per_price = models.DecimalField('Product price', max_digits=15, decimal_places=2) total_price = models.DecimalField('Calculated', max_digits=15, decimal_places=2, editable=False, null=True) amount

Re: function import errors model import in other file

2008-09-22 Thread Gerard Petersen
!! Regards, Gerard. Norman Harman wrote: > Gerard Petersen wrote: >> Hi All, >> >> I'm trying to import a function. When adding this statement I get a Model >> import error in a completely different place, not even related. I've added >> the files from my app directory

function import errors model import in other file

2008-09-22 Thread Gerard Petersen
more exact since it's a deviating filename? Do I need to add the deviating filenames (myforms.py, myfunctions.py) to settings.py or _init__.py? I'm completely lost. Thanx a lot! Regards, Gerard. ## __init__.py empty! ## urls.py from django.conf.urls.defaults import * from django.contrib

Re: sample app for beginner

2008-09-22 Thread Gerard Petersen
Chuck, The Django tutorial should get you going: http://docs.djangoproject.com/en/dev/intro/tutorial01/#intro-tutorial01 And an app. published earlier on this list: http://code.google.com/p/django-todo/ Happy coding. Gerard. Chuck Bai wrote: > Does anyone know a sample Django

Re: IE Hell. Blank Page

2008-09-19 Thread Gerard Petersen
/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038=en And while looking ... lot's more fore IE: http://blogs.msdn.com/ie/archive/2007/06/22/from-microsoft-teched-2007-web-development-tools-for-internet-explorer.aspx Regards, Gerard. Daniele Procida wrote: > On Thu, Sep 18, 2008, lingrlo

Re: Import error: Model based on another model

2008-09-18 Thread Gerard Petersen
Daniel, Thanx for the answer on code execution. As far as the import issue is concerned. I'll have a look at importing specifics. I wouldn't want you to have to dig through my code to find a syntactic typo ... :-) Regards, Gerard. Daniel Roseman wrote: > On Sep 16, 10:08 pm, Gerard Peter

Re: DjangoCon keynote transcript/summary

2008-09-18 Thread Gerard Petersen
on the subjects. Thanx, and happy coding to all! Regards, Gerard -Just another sysadmin- P. Malcolm Tredinnick wrote: > The original summary wasn't a bad summary and Gerard's reactions were > also tongue-in-cheek. But it's important to realise that Cal's > presentation was at the end of a very

Re: DjangoCon keynote transcript/summary

2008-09-16 Thread Gerard Petersen
; - Database migration is painful True! > - Not trendy enough Get a pair of Gucci sunglasses maybe that'll help! > - Needs more frequent releases Possibly > - Dev team needs beards. Show me some pictures > - Wants a pony. Literally. How about some rollerskates .. ;-) Regards,

Re: Import error: Model based on another model

2008-09-16 Thread Gerard Petersen
TW_CHOICES don't get executed in models.py and do get executed in the myforms.py Thanx again! Regards, Gerard. Daniel Roseman wrote: > On Sep 15, 9:34 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote: >> Daniel, >> >> I'm building an invoice system. The data relation

  1   2   >