Tom,
I think you can create a custom format file for that (see [1] ).
Koen
[1] :
https://docs.djangoproject.com/en/1.4/topics/i18n/formatting/#creating-custom-format-files
Op woensdag 10 oktober 2012 12:40:52 UTC+2 schreef Tom Evans het volgende:
>
> Hi all
>
> If you enable USE_L10N=True, t
You should use DEBUG=True in your development settings, so you get a proper
traceback of what is going on.
As far as I can see, you do have syntax errors in your models.py file (eg
line 266). You should fix them first.
As a side note, your unicode methods are not all correct, some of them are
On 31 aug, 17:12, Wim Feijen wrote:
> 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 = [
> '
On 11 aug, 03:15, ydjango wrote:
> I need a reporting library for web based (HTML) reporting with support
> for standard features
> 1) header
> 2) footer
> 3) pagination
> 4) Totals/summary
>
> Reportlab is too low level for my needs and their pro version license
> does not work for me.
>
> Is the
On 18 mrt, 10:12, bruno desthuilliers
wrote:
> On Mar 18, 8:42 am, koenb wrote:
>
> > Take a look at something like django-selectreverse [1] for inspiration
> > on how to reduce your querycount for M2M relations.
>
> > Koen
>
> > [1]http://code.google.com/p
Take a look at something like django-selectreverse [1] for inspiration
on how to reduce your querycount for M2M relations.
Koen
[1] http://code.google.com/p/django-selectreverse/
On 17 mrt, 18:55, TheIvIaxx wrote:
> I made a mistake in my model definitions above. The Term field on
> Image is
On 31 dec 2009, 01:56, Sam Walters wrote:
> Thanks for the replies.
>
> Yes, there is the option of going to raw MySQL. However the project
> requirements mean i can't use raw SQL. (portability, readability)
> From what i can see using django's db API i have to execute the
> queries 500 times.
>
On 20 okt, 21:19, r_f_d wrote:
> Why not do this:
>
> for p in products.objects.all():
> for c in p.categories.all():
> print p,' - ', c
>
> -richard
>
> On Oct 20, 7:57 am, Михаил Лукин wrote:
>
This will obviously leave you with a lot of queries. Take a look at eg
django-selectre
It is quite common to have templates with lists traversing reverse
foreignkey relationships or m2m relationships, which generate a lot of
queries, for example:
{% for building in buildinglist %}
Building: {{ building }}
Appartments:
{% for appart
On 3 jul, 04:59, diogobaeder wrote:
> But where do I put the custom template, than? If I load it from an app
> template, I must create it under /templatetags/, and what if I
> want to call it from the base template? /templatetags/?
>
> Thanks!
>
> Diogo
>
I think you are missing something here:
On 18 mrt, 13:01, MarcoS wrote:
> Hi Adi, thanks for your reply!
>
> I had just tried the DateField.input_formats, but the problem was that
> I'm using the date admin widgets.
> If I specify input_formats like: '%d.%m.%y', I can't use the admin
> widgets 'cause it insert the date in the format: '
> Does anybody know how to control a form's output format of a stored
> DateField? Unfortunately, different countries use different customs to
> represent dates and I'd like to represent the date in another
> international format (%d-%m-%Y). Any help would be very much
> appreciated!
I use the fo
On 3 mrt, 14:32, koenb wrote:
> Do you think this is worth a ticket ?
I created ticket #10403 for this.
Koen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this grou
On 3 mrt, 14:09, Alex Gaynor wrote:
>
> AFAIK the intention was always to eventually have a metaclass so it looked
> more like model forms, but the usecase wasn't as strong, and no one who
> wanted it ever wrote any code AFAIK
>
> Alex
Thank you Alex,
something like this seems to work:
class
Hi all,
I want to use a inlineformset with a highly customized form (it is
based on a specific metaclass and has a customized __init__ function).
Due to the way the inlineformset_factory function works, if I specify
my form in the form argument, the specific form instantiation does not
seem to w
H René,
This is what I use on all my forms (I use my own modelform subclass to
insert these for date fields, but that is not relevant):
as formfield:
class DateFormField(forms.DateField):
def __init__(self, input_formats=None, *args, **kwargs):
super(DateFormField, self).__init__(*a
> def save_model(self, request, obj, form, change):
> super(GamesAdmin, self).save_model(request, obj, form, change)
> if not change:
> #get a tag
> tag = Tags.objects.get(pk=1)
> #associate tag with newly created object
> obj.tag
On 30 jan, 13:46, Russell Keith-Magee wrote:
> If you are interested in implementing this, I'm happy to give you
> pointers. The first pointer I can suggest is that you will be looking
> at the SQLEvaluator class contained in
> django/db/models/sql/expressions.py. This class traverses the
> expr
>
> As committed, the expressions framework is fairly dumb - it is really
> just a way to do two things:
> 1) Expand Django-style field references into column names (and joins
> if required)
> 2) Turn Python expression trees into SQL expression trees.
>
> This means that the operations that are
This is really great! Thanks all for the good work.
Just curious, has there been any work done to make this also work for
dates ?
like in
longevents = Event.objects.filter(enddate__gte=F('startdate')+10)
or something like that ?
Koen
--~--~-~--~~~---~--~~
You
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 the modelform.
>
> Thanx again!
>
> Gerard.
>
> Gerard Petersen w
data here ???
>
> thanks,
> patrick
>
> On Sep 1, 3:39 pm, koenb <[EMAIL PROTECTED]> wrote:
>
> > Are you sure the data will be retrieved twice ? I thought those
> > queryset definitions were lazy, so they are only executed when the
> > widgets are ren
hanks,
> patrick
>
> On Sep 1, 1:51 pm, koenb <[EMAIL PROTECTED]> wrote:
>
> > I have not tried this, but can't you just in your view instantiate the
> > formset and then loop over the forms and set the queryset on your
> > field ?
>
> > Koen
>
&g
I have not tried this, but can't you just in your view instantiate the
formset and then loop over the forms and set the queryset on your
field ?
Koen
On 1 sep, 09:24, patrickk <[EMAIL PROTECTED]> wrote:
> found a solution: with using threadlocals, it´s possible to define a
> custom manager which
s.generic.create_update.create_object' view? I
> want only to use the urls.py without write in views.py to instantiate the
> form.
>
> Is it possible?
>
> Thanks.
> Mario Hozano.
>
>
>
> On Wed, Aug 27, 2008 at 3:34 AM, koenb <[EMAIL PROTECTED]> wrote:
>
Did you look at the information attached to ticket 689 [1] ?
This is about using the credentials provided by the webserver. Typical
use case is having apache authenticate the user (eg via mod_ntlm,
mod_auth_sspi or another authentication system), pass the username
into the django app and use this
Hi Mario,
a few months ago I posted a snippet on djangosnippets [1] that kind of
does something like this: it takes a form (can be the same one you use
for editing) and displays it as read-only. The disadvantage is it uses
the entire form machinery just to display some values, which is a lot
of o
I guess you are seeing the bug reported in #6379. You probably have an
import error somewhere, but it is being hidden by the NoReverseMatch
exception that is raised for anything that goes wrong.
Koen
On 25 aug, 16:13, Robin <[EMAIL PROTECTED]> wrote:
> Hello,
>
> i have the same exception and ex
Robin,
I don't know if this is a 'right' way, but I posted a snippet on
djangosnippets with my DisplayModelForm [1].
Basically, it allows you to reuse your form definitions, but turn them
into a "display_only" mode. You can do all fields or just a few.
I use it to display objects to users, with a
Ok,
just found #5826 which seems to solve my problem. Thanks, kgoudeaux!
On 14 mei, 16:32, koenb <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I was trying to adapt AuditTrail [1] to also automatically add generic
> foreignkey attributes.
>
> The audittrail app now copi
Hi all,
I was trying to adapt AuditTrail [1] to also automatically add generic
foreignkey attributes.
The audittrail app now copies all the fields to the audit model, which
means the contenttype and objectid are copied perfectly, but I would
like to access the referenced object directly from the
Why would you want to do this in admin ? Admin is for ... hmm admins.
If you want your users to change their info: make your own view (very
easy with modelforms) and add the permission check in your view (this
really isn't difficult at all).
Koen
On 6 mei, 15:50, Rodrigo Culagovski <[EMAIL PROT
Sorry;
forgot to add, you will need to wrap the generic view in a custom
wrapper view for that.
On 28 apr, 22:42, koenb <[EMAIL PROTECTED]> wrote:
> The problem is FF does not like it if you do not consume the POST
> data.
> Just add the line
> request.POST
> somewher
The problem is FF does not like it if you do not consume the POST
data.
Just add the line
request.POST
somewhere in your view before redirecting.
Koen
On 28 apr, 17:33, yml <[EMAIL PROTECTED]> wrote:
> Hello,
> I noticed a very strange behavior with the generic view called :
> "delete_object". T
The error message says it all: it is looking for
testporject.polls.views.django.views.static. Notice the first part. It
means your view function is taken from within testproject.polls.views
(which is probably on top in your patterns declaration).
You should take this declaration out of there and a
BTW, you can add tags to builtins if you need them all the time.
eg. if you need i18n all over:
from django.template import add_to_builtins
add_to_builtins('django.templatetags.i18n')
Koen
On 6 feb, 20:59, Adam Stein <[EMAIL PROTECTED]> wrote:
> On Wed, 2008-02-06 at 11:31 -0800, Daniel Rosema
You could take a look at the multidb branch (specifically check out
ticket #4747). It is a bit behind on trunk, but the basics should
work. It allows you to define multiple connections, so you should be
able to connect to the same db using different users.
Koen
On 5 feb, 23:47, Julien <[EMAIL PR
I also have something similar: I created a bunch of display widgets
(displaytextinput, displaytextarea, displayselect,
displayselectmultiple etc.), which override the render method of their
parents and created a subclass of forms.ModelForm for this, which has
a display_only argument on the __init_
Especially take note of the hint to use junction.exe [1]. It allows
you to use kind of like symlinks on windows. Especially interesting if
you use different versions and branches.
Koen
[1] http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx
--~--~-~--~~--
Please also have a look at ticket #4747. It was/is an effort to bring
multi db a little bit closer to trunk. Regrettably, I have not had the
time (nor the need) to continue working on this.
Good luck.
Koen
On 12 dec, 16:25, Derek Steinkamp <[EMAIL PROTECTED]> wrote:
> Thanks for the link, it is
First things first: I would either define a separate Group object
here, or use a many2manyfield if you don't need to know the group
numbers.
Second thing: why use the assembly object if you want to count items ?
You are thinking to much in SQL instead of ORM.
If you say Assembly.objects.count(),
Alexander,
A few weeks ago I came across the same issue (I filed ticket #5663).
The good thing is, making your own replacement filter to bypass the
problem is easy.
On the other hand, Malcolm closed the ticket today as wontfix, stating
it is a bug in markdown.
Though that may be true, I do not
In the latest patches for multi-db the QuerySet that is returned is no
longer fixed, but varies with the model's manager. That should fix
that problem for now.
Koen
On 17 okt, 09:03, Ian <[EMAIL PROTECTED]> wrote:
> I don't know anything about the multi-db branch, but I imagine that
> whatever Q
Hi Mark,
You can find some newer work at ticket #4747. The patches there are
some work in progress trying to bring multi-db back in line with
trunk.
A lot has changed in trunk in the last year, so I think it is worth
trying those out instead of the old branch. Off course there are still
a lot of
Sorry Carlos,
those patches are far from complete, and I don't use Oracle myself.
For the moment the backends in the patches use the following to get
the connection:
connection = self.model._default_manager.db.connection
Removing the import and putting in that line should do the trick.
Hi Heba,
I just tried your project with django trunk r5881: I put everything in
a folder, modified the settings to use sqlite3, created a db, did
manage.py syncdb.
Then I started the development server, looked at 127.0.0.1:8000 and it
seems to work just fine.
What django version are you using ?
There already is a ticket: #4783. Just needs volunteers to do the
writing...
Koen
On 3 aug, 10:41, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> On Aug 3, 4:32 pm, koenb <[EMAIL PROTECTED]> wrote:
>
> > My guess is you are interfering with your admin_media (look
My guess is you are interfering with your admin_media (look at the
admin_media_prefix setting).
Try using something like r'^sitemedia/... and src="/sitemedia/...".
Koen
On 3 aug, 09:16, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> I already did the
>
> (r'^media/(?P.*)$', 'django.views.static.
That fix seems to work ok for me now.
Thanks Ramiro,
Koen
--~--~-~--~~~---~--~~
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 fr
Check ticket 4899. It is the newline thing. The extra chr(13) under
Windows breaks the fix from the ticket.
Koen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send ema
Do I understand correctly that with the unicode branch, databases are
supposed to be providing and accepting utf-8 data ? This assumption is
ok for self-constructed databases, but I am interacting with a legacy
database that is in iso-8859-1 and I can't change that.
Is there a setting somewhere to
51 matches
Mail list logo