Re: Class based generic views in 1.3?

2010-06-11 Thread Patryk Zawadzki
t() t.join() test = View() test(5) 8< Try it now, tests itself. -- Patryk Zawadzki -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe

Re: returning large files from django

2008-08-21 Thread Patryk Zawadzki
le I probably can just save them with random names so random URI attacks are hard to perform, I would then need to setup a cron job to remove old files (and an individual could easily DoS the service by performing a lot of requests until the machine runs out of disk space). -- Patryk Zawadzki --~-

Re: Exposing DeclarativeFieldsMetaclass

2008-08-18 Thread Patryk Zawadzki
s import BoundField In [4]: BoundField? Type: type Base Class: String Form: Namespace: Interactive File: /home/users/patrys/Desktop/web/django/newforms/forms.py Docstring: A Field plus data Constructor information: Definition: BoundField(

Re: The block tag has multiple meanings

2008-06-27 Thread Patryk Zawadzki
": No, please, don't. The master template has no place to "predefine" the blocks as it's structure is outputted verbatim. Child templates on the other hand have no need to define blocks outside of other blocks so it's pretty much useless and prone to infinite loops (insert a pa

Re: Kwippy - micro-blogging using django

2008-06-27 Thread Patryk Zawadzki
to get an instant invite) Wrong list. -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develope

Re: Ordered ManyToMany

2008-06-26 Thread Patryk Zawadzki
are what JS is uses as long as it works and the JS not intrusive (like date and time pickers attach themselves upon page load and are not part of the widget). -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this message because you are subs

Re: Ordered ManyToMany

2008-06-26 Thread Patryk Zawadzki
ring the order. One could use the id > column of the intermediate table. Do you agree that it could be very > simple to write an OrderedManyToMany Field, but simply adding the up/ > down feature to the widget? See above, use an explicit connecting model for many-to-many relations and add tou

Re: pluralize filter bug(?!)

2008-06-11 Thread Patryk Zawadzki
as pl_PL. For example "computer" in Polish: * 1 komputer * 2 komputery [...] * 4 komputery * 5 komputerów [...] * 21 komputerów * 22 komputery [...] * 24 komputery * 25 komputerów but: * 1.1 komputera [...] * 1.9 komputera -- Patryk

Re: Rethinking silent failures in templates

2008-05-21 Thread Patryk Zawadzki
mplating system, by default, problems would be sent to sys.stderr. With the little exception that writing to stdout or stderr from a fcgi/wsgi application will kill your application server with a nice "broken pipe" when deployed on production :) -- P

Re: API question for model saving

2008-04-30 Thread Patryk Zawadzki
eate_strategy=CreateStrategy.MUST_CREATE) > ... That's all great and everything but I fail to see why we need such functionality in django core? Each of the above easily solvable with one abstract model class and as a bonus you get to pick any of the

Re: {{ something or something_else }}

2008-04-25 Thread Patryk Zawadzki
user has {{ num_files|default:"no" }} files -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email t

Re: _QuerySet.first()

2008-04-25 Thread Patryk Zawadzki
you already evaluated the query. -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@

Re: Template.render() should accept a dictionary, not just a Context object

2008-04-11 Thread Patryk Zawadzki
this is that we have to pass an instance of a > subclass of Context, rather than something that has the interface of a > Context. Is it a good idea ? Why not use the opposite test and check for instances of dict? -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~--

Re: new to django / web development altogether

2008-04-11 Thread Patryk Zawadzki
services, then? I just have very little experience in web programming, > as majority of my day is spent doing C# / ADO.NET  > > I would love some pointers or have a discussion. The first technology you should use is called "join django-users and not django-devel

Re: Re: Porting Django to Python 3.0 as a GSoC project

2008-03-28 Thread Patryk Zawadzki
ually switching to python 2.6/3.0. -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@goog

Re: Opportunity

2008-03-05 Thread Patryk Zawadzki
reen high and contains warnings with no legal meaning (at least not where I live). Please also reply below relevant parts of a post when quoting. Should you have further questions please refer to netiquette in order to keep this list clean. -- Patryk Zawadzki PLD Linux Dis

Re: settings imported twice Was: logging & MODPYTHON

2008-03-05 Thread Patryk Zawadzki
viously I need more coffee. Something like that should work though: try: reimported = imported raise Exception, "already imported!" catch NameError: imported = True -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received

Re: Opportunity

2008-03-05 Thread Patryk Zawadzki
ngo developer to work in London. Please > contact me for further details. The role is full time and comes with an > attractive salary. 1) move to django-users 2) fix your signature skyscraper 3) remove legal threats -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~--

Re: ***SPAM*** Re: logging & MODPYTHON

2008-03-05 Thread Patryk Zawadzki
ould be reimporting. > > Somebody who cares to know about this should feel free to roll up their > sleeves and investigate. Should be as easy as adding: imported = False if imported: raise Exception, "already imported!" imported = True at t

Re: Pick a value from list variable in templates

2008-03-04 Thread Patryk Zawadzki
ble to write {{ foo|bar:baz>lorem }} )? -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-de

Re: ModelForms paranoia simplification?

2008-02-14 Thread Patryk Zawadzki
On Thu, Feb 14, 2008 at 8:14 AM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Any strong objections to not behaving like Python here? The less magic the better. -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received thi

Re: Bug saving NUL character?

2008-02-07 Thread Patryk Zawadzki
f one field. SQL termination in the middle of a quoted string would result in a failed transaction. Also, AFAIR Django uses prepared statements so there's no possibility to execute code from a bound variable. -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~-

Re: Simple Generic Views, Login_Required

2007-12-26 Thread Patryk Zawadzki
recommend this tweak be added. Generic views are just regular methods so it would be easier to create a one line wrapper calling the original and decorate it with @login_required -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received thi

Re: Odd MySQL bug

2007-12-20 Thread Patryk Zawadzki
eople from hitting this bug even when using custom queries (like QuerySet.extra) and would eliminate any need of workarounds as django itself does not depend on such quirks and oddities in SQL behaviour. -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~

Re: Generic Relation: Alter Table

2007-12-20 Thread Patryk Zawadzki
t; > And I am using a class called Book which will be having the summary > field mentioned above. So to alter the Book model at the database > level, i need to run the alter table for Book. I dont know the > equivalent sql to create a generic relation column in the table. Just run ./manage.p

Re: Odd MySQL bug

2007-12-19 Thread Patryk Zawadzki
t; Now things get really weird: If you cut and paste the line that is > failing so you that you run it twice in a row, it fails the first time > (returning a row) and passes the second time (returning nothing)! Are you sure these are not artifacts from a previous query? Maybe the cursor was

Re: Django weekly updates?

2007-12-11 Thread Patryk Zawadzki
2007/12/11, Rob Hudson <[EMAIL PROTECTED]>: > On 12/11/07, Patryk Zawadzki <[EMAIL PROTECTED]> wrote: > > Why not use > > http://code.djangoproject.com/timeline?ticket=on=50=90=rss > > ? > > I am actually. But I did just realize the description field

Re: Is 'LIMIT 0' a valid query?

2007-12-11 Thread Patryk Zawadzki
2007/12/11, Ian Kelly <[EMAIL PROTECTED]>: > On Dec 11, 2007 4:16 AM, Patryk Zawadzki <[EMAIL PROTECTED]> wrote: > > Semantics of COUNT require counting all non-NULL values and some more > > naive databases might actually try to fetch all the columns while 1 >

Re: Django weekly updates?

2007-12-11 Thread Patryk Zawadzki
s *could* be automated but it would be much simpler if > truncation wasn't so short. I don't know Trac so I'm not sure if this > is a setting or not. Why not use http://code.djangoproject.com/timeline?ticket=on=50=90=rss ? -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~--

Re: Is 'LIMIT 0' a valid query?

2007-12-11 Thread Patryk Zawadzki
t to the same results. > > The COUNT(*) in this case returned 0, and the SELECT which followed it > ran the full query but with LIMIT 0 on the end. Speaking of which, since we want a number of all matching rows, wouldn't COUNT(1) be more optimal? -- Patryk Z

Re: autoescape wrong approach

2007-12-10 Thread Patryk Zawadzki
mark some data as safe for output (for example some HTML coming from RSS already parsed by BeautifulSoup) by encapsulating it in the correct classes. -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Changing label style in some widgets RE: 4860

2007-12-05 Thread Patryk Zawadzki
uses this arrangement: > > Python Which is also correct but slightly less desired. So please count me as -1. -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &qu

Re: newforms-admin change history

2007-12-04 Thread Patryk Zawadzki
initial data. +1 from me, BaseForm sounds useful. On the other hand all the magic is tied to Form (including the metaclass) and most forms already extend the Form itself (and form_for_* can be told to do so by passing Form as their base class parameter). -- Patryk Zawadzki PLD

Re: DB API - the limiting syntax, is it magic?

2007-12-04 Thread Patryk Zawadzki
has > been retrieved). > > The ideal API would look like this, and it would only run a single query: > > objects = MyModel.objects.filter(site=1) > first_one = objects[0] Maybe introduce a resolve() or results() call that just returns list(self)? --

Re: Changes to request_response have broken django-rest-interface

2007-12-03 Thread Patryk Zawadzki
ith no data (e.g. a form with checkboxes and maybe some fields > that aren't filled in). That's why we introduced request.method. What about sending a POST to a GET-encoded URI? You get both GET and POST then with possibly overlapping values. -- Patryk Zawa

Re: Shameless plug - django-google

2007-12-03 Thread Patryk Zawadzki
g the discussion for a long time and it seems there is no conclusion on the approach. -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" gro

Shameless plug - django-google

2007-12-03 Thread Patryk Zawadzki
. (Please note that we are using the trunk of Django and the code was not tested to work against the stable release, it would also benefit from being able to subclass models if that feature goes into trunk before 1.0) -- Patryk Zawadzki PLD Linux Distribution

Re: Django 1.0 features -- the definitive list

2007-11-30 Thread Patryk Zawadzki
2007/11/30, Malcolm Tredinnick <[EMAIL PROTECTED]>: > On Fri, 2007-11-30 at 16:46 +0100, Patryk Zawadzki wrote: > > For my needs: > > > > * Extendable results of form_for_{instance,model} (sometimes you just > > need to override one field in a large form) > &g

Re: Django 1.0 features -- the definitive list

2007-11-30 Thread Patryk Zawadzki
e field in a large form) * Sortable fields on forms extending other forms Both are taken care of in http://code.djangoproject.com/ticket/5986 -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: Django 1.0 features -- the definitive list

2007-11-30 Thread Patryk Zawadzki
0-based apps could be moved to different relative mount > points > without changing .py files at all. Or was this resolved when I wasn't > looking? Start using lighttpd + fcgi instead of Apache ;) -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~--

Re: hey all

2007-11-29 Thread Patryk Zawadzki
ly. [...] > Kindly visit www.swtech.njit.edu and help us to cater you better. > I hope to see a positive response from you all. Doesn't work for me. No such DNS record. -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this mess

Re: Session Hijacking in Django

2007-11-26 Thread Patryk Zawadzki
SSL certificates can be bruteforced if you throw enough computing power at them). -- Patryk Zawadzki PLD Linux Distribution --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" gro

Re: Fixtures without a pk

2007-11-23 Thread Patryk Zawadzki
is only used to link the objects together > when importing the data? So just add and implement pk_key="discard" as parameter inside a fixture? Then the ids are only relevant in the context of matching them inside that particular fixture. -- Patr

Re: ticket #5986, reviews welcome

2007-11-23 Thread Patryk Zawadzki
is more than handy in cases where the original form is beyond your control (comes from another application) but also allows people to create Form subclasses that extend results of form_for_{instance,model}. Also, regression tests are included so all is guaranteed to work. Than

Re: Fixtures without a pk

2007-11-23 Thread Patryk Zawadzki
is seriously considered for inclusion into trunk. How about structured markup? Both js, python and xml markup allow for objects to include other objects. It could be for example: ({name: 'bar', foo_set: ({field: 'baz'}, {field: 'ipsum'})}, {name: 'lorem'}) -- Patryk Zawadzki PLD Linux Distribution

<    1   2