Re: Django queries with dates and __lte

2011-09-09 Thread Axel Bock
Indeed :) . I'd never have guessed that. Thanks, Axel. Am 08.09.2011 um 17:47 schrieb Shawn Milochik: > I think your order by needs to be "-start" instead of "start," then > take [0] instead of [:1]. That will get the newest entry that matches > your query. > > -- > You received this message

Django queries with dates and __lte

2011-09-08 Thread Axel Bock
Hello list, I have a little trouble setting up a Django query. In my app the user logs time spans by entering two time points. I want to make sure that a time span logged is not within another span already entered. Example: ONE goes from 1000 to 1200, TWO goes from 1400 to 1600. Now I want us

Re: dynamic field display

2011-08-24 Thread Axel Bock
on the fly, depending upon the form definition parameters > provided to the generator function during runtime. Obviously you need to be > careful with this, and consider the cons coming with it. > > > On Tue, Aug 23, 2011 at 12:01 AM, Axel Bock > wrote: > Hi group, > >

Re: CSS question

2011-08-22 Thread Axel Bock
ross browser/version. > > http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/ > > > > On Mon, Aug 22, 2011 at 7:35 PM, Axel Bock > wrote: > Hah! I can answer something on a Django-list - oh joy :) . > Yes, indeed I have an idea. *inline-block* may be t

Re: CSS question

2011-08-22 Thread Axel Bock
Hah! I can answer something on a Django-list - oh joy :) . Yes, indeed I have an idea. *inline-block* may be the css thing for you. A very nice example for that is here: http://www.brunildo.org/test/inline-block.html Go to http://www.brunildo.org/ to have an overview over a lot of other stuff,

dynamic field display

2011-08-22 Thread Axel Bock
Hi group, I have another question about Django forms. I designed a Form for a Model, but now I want to remove fields depending on some user settings. Can I do that? Lets assume the following: class MyModel(models.Model): field1 = TextField(null=True, blank=True) field2 = Textfield(nu

Re: extending the User profile - which way to go?

2011-08-21 Thread Axel Bock
Thanks for all your replies, it makes sense to wait until it's a performance problem :) Greetings, Axel. Am 21.08.2011 um 22:14 schrieb Simon Connah: > On 21 Aug 2011, at 19:37, Shawn Milochik wrote: > >> Using a OneToOne field does the same thing as a FK with unique set to true, >> and si

extending the User profile - which way to go?

2011-08-20 Thread Axel Bock
Hi again, I will need to add some properties to a user in the future. Now I found two ways of doing it. First, the Django-way (as described in the Django docs). Then I found some other posts from other people, all doing an inheritance of the original User-class and using this one. That seems ra

Re: View-Voodoo: Calling functions in a view does weird things

2011-08-20 Thread Axel Bock
I am _*SO*_ stupid. and equally embarrassed right now. oh boy. thank you so much. Am 20.08.2011 um 18:07 schrieb Yaşar Arabacı: > Do it like this: > > def myview(request): >if request.method =="POST": >return call_my_other_func(request) >else: rtr("index.html") > > def ca

View-Voodoo: Calling functions in a view does weird things

2011-08-20 Thread Axel Bock
Hi all, I am new to this list (hello btw :), a beginner of Django, and I have discovered a _very_ strange thing. Basicall I have a view handling a file upload (see shortened code below). Depending on a select field a function gets called handling the stuff, and returning. (rtr = render_to_response

Re: Looking for IDE + FTP

2011-02-13 Thread Axel Bock
"looks"? tried them yourself? :) for me it looks like aptana tried to focus on ruby/rails, while pycharm definitely focuses on python/django. -Axel. 2011/2/13 Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> > Aptana looks nice, PYCharm looks a bit ugly :/ > > On Sat,

Re: Looking for IDE + FTP

2011-02-11 Thread Axel Bock
hm, I'm using pycharm right now, and I really think it "kicks ass" ;) havent looked at the other "usual" ones (komodo, wing, eclipse, etc.) for a long time, though. about ftp ... looks like it: http://www.jetbrains.com/pycharm/webhelp/deployment-connection-tab.html cheers, axel. 2011/2/11 jose

Re: Filtering Queryset by Foreign Key Properties

2011-02-11 Thread Axel Bock
Hi, try this, I guess this should workd (being new here myself :): OrderPositions.objects.filter(order__type = "A") and maybe have a look here: http://docs.djangoproject.com/en/1.2/ref/models/querysets/#field-lookups Cheers, Axel. 2011/2/11 josch > Hi, > > I`m searching for a solution for

DateTime entry like in the admin interface

2011-02-11 Thread Axel Bock
Hi again, I have in my model a DateTime input, which the admin interface automatically displays as two separate DATE and TIME input fields. I would like to do that, too. Can anyone tell me how? :) Thanks & greetings, Axel. -- You received this message because you are subscribed to the Google

Re: model form validation

2011-02-05 Thread Axel Bock
f() - it didn't get called. Any ideas, why? Axel. 2011/2/5 Shawn Milochik > On 02/05/2011 01:08 PM, Axel Bock wrote: > >> practically: >> - the user enters "0300" in the datetime field. >> - I make "0300" into date=0, time=03:00, valid field

Re: model form validation

2011-02-05 Thread Axel Bock
let's make an example: in the datetime fields of the forms there will only be a time, which is ok for the user. the date will be added later by some background logic, for convenience. practically: - the user enters "0300" in the datetime field. - I make "0300" into date=0, time=03:00, valid field.

model form validation

2011-02-05 Thread Axel Bock
hi all, really, I don't get this model form validation stuff. And currently, right now, I am immensely p*** off, because either the documentation is horribly bad (at least for me) or I am simply way too stupid. okay, enough rant, let's get practical - on to my little problem. I want to do model f

Re: need help following tutorial part 1

2011-01-29 Thread Axel Bock
out the full path. > > C:\Python27\Scripts\django-admin.py startprofect mysite > > C:\Python27 is already added to my windows' PATH. Proably will need to > add C:\Python27\Scripts to it too. > > > On Jan 30, 1:44 am, Axel Bock wrote: > > hm ... my windows times are

Re: need help following tutorial part 1

2011-01-29 Thread Axel Bock
hm ... my windows times are over quite a while, BUT ... 1) try associating the .py extension with the python commandline interpreter. 2) syntax error? send a screendump maybe, or your exact command line ... it _should_ work without problems. can you execute other simple python scripts? cheers,

Re: modelformset not iterable

2011-01-24 Thread Axel Bock
forget it. it was formset.forms ... I *SWEAR* there is another example just with "for form in formset" ... thanks anyway :) Axel. 2011/1/25 Axel Bock > Hello all, > > I am trying to implement something quite simple, in my eyes. But it does > not work at all ... .

modelformset not iterable

2011-01-24 Thread Axel Bock
Hello all, I am trying to implement something quite simple, in my eyes. But it does not work at all ... . Basically, I create a modelformset_factory with a model of mine, and pass the instantiated modelformset to my template to render. And I get the message *Caught TypeError while rendering: 'LegF

Re: ModelForm validation

2010-12-30 Thread Axel Bock
): >topic = form.clean_data['topic'] > > Now if you wanted to overide the topic, you could instead have: > topic = 'my custom text' > > > Hope this is clearer! > > Derek > > On Dec 29, 4:07 pm, Axel Bock wrote: > > hi

Re: ModelForm validation

2010-12-29 Thread Axel Bock
he form POST and data > "clean" (see: > http://docs.djangoproject.com/en/dev/topics/forms/?from=olddocs#processing-the-data-from-a-form > ) > > HTH > Derek > > On Dec 28, 10:21 pm, Axel Bock wrote: > > Hi all, > > > > I have this little problem. In my little webapp I

ModelForm validation

2010-12-28 Thread Axel Bock
Hi all, I have this little problem. In my little webapp I have a data model which defines several required fields. Depending on WHO is logged on, some of these fields should not be changed by the user and be pre-filled (or better: post-filled) by the application. Currently I delete the fields out

Formsets, forms and related editing

2010-09-28 Thread Axel Bock
Hello again, after some trying and not coming to a successful end I might need a hint or two with the following construction. Assume a pilots flight log: Each flight can have several legs, and a purpose. So basically the model looks like this: Mission: Pilot Purpose ... Leg: Mis

Re: JavaScript with Dango

2010-09-26 Thread Axel Bock
I gotta say this is the kind of answer which usually upsets me for obvious reasons, although I gotta admit the question surely is not very well phrased, too :) But well. I just discovered dajaxproject.com from another thread - maybe you could start from there. It seems to be a framework which coup

Re: Python unexpectedly quit

2010-09-24 Thread Axel Bock
maybe I was a little bit out of sleep today :) . tried to get auth.User subclassing working til 4am in the morning ... and what do you mean with "not picky enough"? 2010/9/24 Steve Holden > On 9/24/2010 2:23 PM, Axel Bock wrote: > > Anything wrong here? I must say, th

Re: Python unexpectedly quit

2010-09-24 Thread Axel Bock
oh f... thanks. 2010/9/24 Scott Gould > > > def logout(request): > > logout(request) > > Infinite loop, no? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To u

Re: subclassing UserCreationForm

2010-09-24 Thread Axel Bock
2010/9/24 Jason > > "Creating the relationship between User and UserInfo has some > implications I'd like to avoid on a model-level" > > Specifically what are you referring to here? Because anytime you > subclass in Django you are basically doing the exact thing in the > database behind the scene

Python unexpectedly quit

2010-09-24 Thread Axel Bock
HI all, another problem here: On my system (MacBook Pro, OS X newest version) Python "unexpectedly" quits when I invoke localhost:8000/logout. The code for that looks like this: #urls.py: urlpatterns += patterns('webflog.flightlog', # (r'^logout/', 'views.logout'), ) #

Re: subclassing UserCreationForm

2010-09-24 Thread Axel Bock
Thanks a lot for your answers. I thought subclassing users is a nice idea, cause a Student IS a user, with a few extended attributes. I decided to subclass users, because ... * when adding a UserInfo -> user relationship (class UserInfo(Model): user = ForeignKey('User')), ALL users having a useri

subclassing UserCreationForm

2010-09-23 Thread Axel Bock
Hello all, I must admit - I am going crazy. With something I thought should be incredibly simple, but maybe I am just too f**king stupid. All right, here comes my problem. I have subclassed "User" as "Student" and added some required fields, one of them being "Course": # models.py class Student(

Re: Relationship question: What do I do wrong?

2010-09-18 Thread Axel Bock
wow, thanks a alot guys for those efforts. indeed, that explanation is better than the original docs :) . I get it now, I changed it, and I guess the data model (v1.0 ...) is sufficient for the first test run. it's nice btw to get such a good support here in the forums! this is not granted at all.

Re: Relationship question: What do I do wrong?

2010-09-18 Thread Axel Bock
thanks for all the explanations! i had a look into the database tables - and they do just what i expected. so I just leave it at changing the referal property names ... thanks & greetings, Axel. 2010/9/18 bruno desthuilliers > On 18 sep, 16:23, Axel Bock wrote: > > 20

Re: Relationship question: What do I do wrong?

2010-09-18 Thread Axel Bock
2010/9/18 bruno desthuilliers > > On 18 sep, 08:26, Axel Bock wrote: > > Now I get an error when compiling this. > > s/compiling/importing/ > yah, all right :) . > > Any help here? I'm quite new to dango, so a little hint would be > > nice :) >

Relationship question: What do I do wrong?

2010-09-18 Thread Axel Bock
Hello, I am currently experimenting with a little webapp, and I have the following problem. I want to assign two properties of the same type to a class. (Stupid) Example: I have a meal, and it comes with two sides. The sides itself are another database key - they can change on a whim :) . It looks