Re: Pluggable Q&A app?

2010-05-15 Thread Max Battcher
x27;t had an excuse to try it myself, but it might be what you are looking for. -- --Max Battcher-- http://worldmaker.net -- 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.c

Re: State of the Django MPTT Art?

2010-02-11 Thread Max Battcher
rage needs change.) I think its documentation does a pretty good job describing the trade-offs between the various storage methods it supports, and certainly the best form depends on the data being stored. -- --Max Battcher-- http://worldmaker.net -- You received this message because you are sub

Re: DateTimeField arithmetic problem

2009-12-04 Thread Max Battcher
has no attribute 'timedelta' This sounds like a silly import error... It sounds like you've got something like: from datetime import datetime Where you really want just: import datetime (Because datetime.datetime.timedelta doesn't exist, but datetime.timedelta does.) -- --

Re: Sick of defining urls

2009-12-03 Thread Max Battcher
y under TEMPLATE_LOADERS, most apps' templates should just work. No template path fiddling or symlinks necessary. Throw in the egg loader if you are using apps in eggs; write your own loader for custom needs; etc... -- --Max Battcher-- http://worldmaker.net -- You received this message becau

Re: domains vs sub-domains

2009-11-09 Thread Max Battcher
a CloudFront distribution, potentially without having to touch any of my HTML for "instant" bonus performance. Having all my static media hosted by good static media hosts saves me time to think about my dynamic content and tools. Your mileage may certainly vary. -- --Max Battcher--

Re: tag counts

2009-11-05 Thread Max Battcher
That app provides just about everything one needs for tagging, including template filters for tag clouds. -- --Max Battcher-- http://worldmaker.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Re: Marking usernames as not for use dynamically

2009-11-02 Thread Max Battcher
years), but I think sometimes the tilde as a sign of a user page is forgotten/under-rated in modern URL planning. -- --Max Battcher-- http://worldmaker.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users

Re: How to get a queryset?

2009-10-19 Thread Max Battcher
omething that I generally find useful in situations like that is Python's groupby function from itertools. -- --Max Battcher-- http://worldmaker.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Django with Cherokee web server

2009-10-09 Thread Max Battcher
ck on wood), and its been running stably for a few months now without the need for any further configuration tweaks or resets. -- --Max Battcher-- http://worldmaker.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

ANN: Agoranomos (7.12.11)

2007-12-10 Thread Max Battcher
d the next eBay with it, I'd love a small cut. ;) -- --Max Battcher-- http://www.worldmaker.net/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: ValidationErrors

2006-06-30 Thread Max Battcher
t for some better way. > > I was thinking of creating a custom tag, but thought I'd ask to make > sure I wasn't missing something. {{ form.name.html_error_list }}, wraps it in a -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I hav

Re: Template: nested for and ManyToMany field problem - MySQL

2006-06-18 Thread Max Battcher
te_url }} > {% endfor %} > > entry.categries is ManyToManyField Then you want entry.categories.all in your template. -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world / and in the end I'll get the gr

Re: POST to view loses POST data

2006-06-17 Thread Max Battcher
ary to force true? > > Yeah, this is kludgy, but the alternative is to put in a attribute on > the request object to say "is this a post?" or force people to fix > "bugs" in their valid HTML. :) That's what request.META["REQUEST_METHOD"] is for. http:

Re: I think I'm doing something wrong...

2006-06-06 Thread Max Battcher
Elver Loho wrote: > Sadly it seems you, along with so many, many others, have fallen into the easiest problem in the book. Your action address should have a following /. http://code.djangoproject.com/wiki/NewbieMistakes#POSTtoviewslosesPOSTdata -- --Max Battcher-- h

Re: Unhappy, reinventing

2006-05-25 Thread Max Battcher
rd thing and not something that I'd want to build with the DOM approach. -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world / and in the end I'll get the grrrl!" --Mach

Re: save() called 2 times.

2006-05-05 Thread Max Battcher
uncate after so many characters just so that URLs don't get out of hand... not to mention all the wasted characters sent in your HTTP responses and emails mentioning unrealistically long URLs. -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have co

Re: ATTENTION: magic-removal being merged to trunk TODAY

2006-05-01 Thread Max Battcher
ake an optional revision number as an argument (IIRC, --rev=) and it will "de-update" (update your working copy to a previous revision). -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come

Re: MR Branch diff than MR trunk?

2006-04-30 Thread Max Battcher
to keep up with Django changes (which is how you should grab the latest magic-removal code), once the merge happens all you need to do is ``svn switch`` to Django's trunk. -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world

Re: How can users only edit their own files?

2006-04-30 Thread Max Battcher
s on browser/OS) the page? -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world / and in the end I'll get the grrrl!" --Machinae Supremacy, Hero (Promo Track) --~--~-~--~~~---~--~~ You re

Re: Ecommerce & Django

2006-04-13 Thread Max Battcher
go in the name you could probably get it approved. With that said, I have a stupid, but simple suggestion: djecommerce, which is obviously superior to normal ecommerce in that g (dje) is e + 2! -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to

Re: Pluggable User/Registration/Authentication App?

2006-04-12 Thread Max Battcher
ws in trunk/0.91 or in django.contrib.auth.views in M-R. These give you the action code and then you just need to write the templates for your site and wire the views somewhere in your urls. -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have c

Re: querying for an empty set in m-r?

2006-04-12 Thread Max Battcher
Russell Cloran wrote: > Hi, > > On Tue, 2006-04-11 at 21:20 -0400, Max Battcher wrote: >> if sometag.article_set.count() == 0: >> pass # your code here > > This will test if one tag has an empty article_set. AFAICT, the question > is on how to find all tags w

Re: querying for an empty set in m-r?

2006-04-11 Thread Max Battcher
dels.Model): > tags = models.ManyToManyField(Tag) > > > Each Article can be associated with multiple Tags and vice versa. > How can I query the Tag model to obtain all Tags with no associated > articles? (m-r) I basically want to delete unused tags. > > T

Re: Using _pre_delete() to stop execution

2006-04-11 Thread Max Battcher
On 4/11/06, Glenn Tenney <[EMAIL PROTECTED]> wrote: > > On Tue, Apr 11, 2006 at 02:24:04PM -0400, Max Battcher wrote: > > You are free to raise your own exception in the path that fails to > > call super().delete() in M-R. > > Then perhaps the docs etc. should inst

Re: Django time-zone chaos

2006-04-11 Thread Max Battcher
tions pulls data from an outside application, which in turn has its own ideas about Time-Zone... -- --Max Battcher-- http://www.worldmaker.net/ All progress is based upon a universal innate desire on the part of every organism to live beyond its income. --Samuel Butler --~--~-~--~~-

Re: Using _pre_delete() to stop execution

2006-04-11 Thread Max Battcher
u are free to raise your own exception in the path that fails to call super().delete() in M-R. -- --Max Battcher-- http://www.worldmaker.net/ All progress is based upon a universal innate desire on the part of every organism to live beyond its income. --Samuel Butler --~--~-~--~~--

Re: post data always empty

2006-04-10 Thread Max Battcher
stakes#POSTtoviewslosesPOSTdata -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world / and in the end I'll get the grrrl!" --Machinae Supremacy, Hero (Promo Track) --~--~-~--~~~---~--~~ You rece

Re: Column [Datefield] cannot be null

2006-04-10 Thread Max Battcher
x27; cannot be null") > Exception Location: > /usr/lib/python2.3/site-packages/MySQLdb/connections.py in > defaulterrorhandler, line 32 > > What have I missed? This is a constraint in the database that is complaining, which means that your table in the database is not the sa

Re: To app or not to app?

2006-04-08 Thread Max Battcher
, and I just try to follow good code modularization principles. -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world / and in the end I'll get the grrrl!" --Machinae Supremacy, Hero (Promo Track) --~--~-~--~~---

Re: ImageField upload_to

2006-04-05 Thread Max Battcher
timster wrote: > Should the super() method work even though I'm not using MR? No. super().save() only works in MR. You'll need the _pre_save() and _post_save() hooks in .91 or trunk. -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have

Re: ImageField upload_to

2006-04-05 Thread Max Battcher
timster wrote: > Should the super() method work even though I'm not using MR? No. super().save() only works in MR. You'll need the _pre_save() and _post_save() hooks in .91 or trunk. -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have

Re: magic-removal - count with a condition

2006-04-04 Thread Max Battcher
hat intended? What would be a workaround? foo.objects.exclude(somecondition).filter(othercondition).count() The lazyness of the new QuerySets means that the above simply creates a COUNT query, no matter how many exclude()s and filter()s you might combine. -- --Max Battcher-- http://www.worldma

Re: How to query roots in a model hierarchy

2006-04-01 Thread Max Battcher
jango version as appropriate), you have a parent_id__isnull=True as one of the arguments. (Note the double underscore before isnull and the single underscore before id.) -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world / and i

Re: overriding User class

2006-04-01 Thread Max Battcher
he django source code ? >> > > Have a look at this for one way to do it: > > http://code.djangoproject.com/wiki/ExtendedUserModel Another possibility is to create your own Model with a OneToOne relationship, or ForeignKey relationship, as appropriate, and then use lookups as ne

Re: Overthinking urls.py?

2006-03-30 Thread Max Battcher
icular case, because you are going to have a strong, repetitive pattern here in your ABSOLUTE_URL_OVERRIDES, and that isn't very DRY, is that maybe you could use some sort of pattern matching in ABSOLUTE_URL_OVERRIDES like being able to use 'mya

Re: Overthinking urls.py?

2006-03-30 Thread Max Battcher
y convenience to fix this seperation problem, and with it you can do all sorts of crazy things (thanks to the pythonic ability to pass around functions) like implement your own project-specific mini-routes or whatever (see my previous post on the subject). -- --Max Battcher-- http://www.worldmaker

Re: Custom templatetags are ignored. Why ?

2006-03-29 Thread Max Battcher
hon shell. Basically: python manage.py shell >>> from myproject.myapp.templatetags import news_tags -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world / and in the end I'll get the grrrl!" -

Re: Mixing with Mailman?

2006-03-28 Thread Max Battcher
ting in that the Mailman website TODO list for Mailman 3 requires almost a Django-like framework (decent db support, decent template engine). Near there it points to one similar attempt, a Zope-Mailman integration: http://www.zope.org/Members/srichter/Products/ZMailman Maybe that will offer some i

Re: Overthinking urls.py?

2006-03-28 Thread Max Battcher
def urlfromconf(object, path): urlconf = __import__(path) return urlconf.absolute_url(object) ABSOLUTE_URL_OVERRIDES = { 'myapp.somemodel': lamda o: urlfromconf(o, 'myapp.urls.somemodelrelated'), } Then in myapps.urls.somemodelrelated: def absolute_url(object): retu

Re: choices

2006-03-27 Thread Max Battcher
e out how. If you visit the Admin's documentation site (link in the top bar), under Models it will point you to the fact that Django magically creates a function for you to do just that. In your example this would be: something.get_kind_display() -- --Max Battcher-- http://www.worldmaker

Re: Overthinking urls.py?

2006-03-27 Thread Max Battcher
ere there are multiple uses of your model objects (ie, two projects sharing an application), Django also provides, for your settings.py file, the ABSOLUTE_URL_OVERRIDES setting, which you can look up in the appropriate documentation. -- --Max Battcher-- http://www.worldmaker.net/ All progress is

Re: Generic views in magic removal

2006-03-22 Thread Max Battcher
Arthur wrote: > urlpatterns = patterns( > 'django.views.generic.list_detail', > (r'(\d+)/$', 'object_detail', info_dict), > ) I think I figured it out, your RegEx should be: (?P\d+)/$ -- --Max Battcher-- http://www.worldmaker.net/ "I

Re: Advice on using model to bulk/batch load database

2006-03-22 Thread Max Battcher
ple to create a datetime.date object which you can directly assign to the DateField. -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world / and in the end I'll get the grrrl!" --Machinae Supremacy, Hero (Promo Track)

Re: Generic views in magic removal

2006-03-22 Thread Max Battcher
list_detail', > (r'(\d+)/$', 'object_detail'), > ) > Shouldn't that be: urlpatterns = patterns( 'django.views.generic.list_detail', (r'(\d+)/$', 'object_detail', info_dict), ) Your example you aren't passing

Re: magick-removal: Suggestion

2006-03-20 Thread Max Battcher
cheme, as being conceptually different. In most cases you should keep in mind that the entire namespace is just as much a part of the naming scheme as the class name itself. There's no reason to add verbosity to your class names that is already in your namespace name(s). -- --Max Bat

Re: Advice on developing with django for a team of 10+

2006-03-16 Thread Max Battcher
commit', though, this doesn't automatically post the change to some central server. Instead, you can then "sit" on the patch and let others 'darcs pull' it from your repository, or you can 'darcs push' it to some other repo or even 'darcs send'

Re: Confusion about templates directory location

2006-03-14 Thread Max Battcher
in this. And is there a "default" > place I can put templates where I won't need to set TEMPLATE_DIRS to > just keep it simpler? If you have the "app" loader in your setting.py file under TEMPLATE_LOADERS, it should automatically look under the "templates"

Re: newbie question about admin module

2006-03-04 Thread Max Battcher
ow=True and the Admin will autofill it with the "current time" (which becomes the last modified date). There is no current way to do the same with User, but there is a proposed CurrentUserField in the works. -- --Max Battcher-- http://www.worldmaker.net/ --~--~-~--~~-

Re: Django in a Load-Balanced environment (ORM issues) ...

2006-02-28 Thread Max Battcher
ving that support, and then when Django does provide something that you are happy with you can pull out your custom save() code and the rest of your code probably won't notice. You can even write your own object "Manager" to have fuller control of object caching and t

Re: Model Basics

2006-02-28 Thread Max Battcher
a side note, I could use the ability to have custom non-Model-Fields (ie, not persisted in the database, only used in the save() ChangeLog generation) in the Admin, is there an existing way to do this?) -- --Max Battcher-- http://www.worldmaker.net/ All progress is based upon a universal innate de

Re: accessing user info in templates

2006-02-20 Thread Max Battcher
-Removal changes things up, of course, check out the Descriptor stuff. -- --Max Battcher-- http://www.worldmaker.net/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Simple weblog, generic views and templates -- error

2006-02-19 Thread Max Battcher
t;archive*" views do exactly what they say and only display old/archived entries. So, if you have the date set to some time in the future, there is your answer on why you won't see them. -- --Max Battcher-- http://www.worldmaker.net/ --~--~-~--~~~---~-

Re: Please help with django tutorial #2

2006-02-17 Thread Max Battcher
e used by the admin and auth, including the Content Types table that is giving you your reported error message. -- --Max Battcher-- http://www.worldmaker.net/ "History bleeds for tomorrow / for us to realize and never more follow blind&quo

TZ Interactions

2006-02-14 Thread Max Battcher
Do I need to just move the uglier ("EST5EDT...") syntax? Is there any "best practice" in this situation that works well cross-platform? -- --Max Battcher-- http://www.worldmaker.net/

Re: is_member_of method for user objects

2006-02-11 Thread Max Battcher
ally. It is it "too much" logic, and that is in some way an aesthetic judgment. -- --Max Battcher-- http://www.worldmaker.net/

Re: Recursive self referring foreignkeys

2006-02-10 Thread Max Battcher
de.djangoproject.com/wiki/CookBookCategoryDataModel - --Max Battcher-- http://www.worldmaker.net/ --~--~-~--~~~---~--~~ 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@g

Django and PCMEF vs MVC

2006-02-10 Thread Max Battcher
A few thoughts on architecture: http://blog.worldmaker.net/node/211 I had architecture thoughts in my head from class and felt I could apply them somewhat to Django. I'm not sure if its useful or interesting, but hopefully somebody might find use of it or interest in it. -- --Max Bat

Re: recursive template calls

2006-02-08 Thread Max Battcher
ource under the LGPL. -- --Max Battcher-- http://www.worldmaker.net/

Re: Tree View

2006-02-05 Thread Max Battcher
lly want a true list view I need to build a custom tag. Right now I think I'm just going to spread the tree out across the URL space. -- --Max Battcher-- http://www.worldmaker.net/

Re: Tree View

2006-02-04 Thread Max Battcher
neric, though... something to produce nice semantic XHTML (s). I'll ponder on this subject a bit more later. -- --Max Battcher-- http://www.worldmaker.net/

Tree View

2006-02-03 Thread Max Battcher
ev --extends-> base_sidebar --extends-> base). Has anyone else experienced this? Does anyone else have any experience to share on tree views? Otherwise I guess its time for a major refactor... -- --Max Battcher-- http://www.worldmaker.net/

Re: Lookup by week

2006-01-30 Thread Max Battcher
e different definitions of when they start, etc. Then, if weeks are implemented, you start to get requests for fortnights and scores... -- --Max Battcher-- http://www.worldmaker.net/

Re: Extending User

2006-01-30 Thread Max Battcher
let the Admin show your object in the main User form. (OneToOne currently doesn't support that, albeit it really needs the reverse edit_inline.) The upcoming Subclassing changes are going to make this route even easier for OneToOne relationships. -- --Max Battcher-- http://www.worldmaker.net/

Re: error restoring project

2006-01-30 Thread Max Battcher
oproject.com/ticket/930) dealing with the One-To-One relationship. The SQL is not creating the proper JOIN for the default ordering and you need to explicitly create an ordering='title' in your Meta class so that is isn't ordering based on a field in the other class. I'm assuming this isn't being fixed right now because the Subclassing system will replace it. -- --Max Battcher-- http://www.worldmaker.net/

Re: RoR Ajax helpers port to Django tags?

2006-01-25 Thread Max Battcher
The typical HTML view for a Django site) /mysite/coolthings/1.xml Overall it would be subtle "opt-in" and shouldn't affect the current behavior (ie, if the generic view+template loader doesn't know the expected output format, default gracefully to the default in setting

Re: magic_removal table update

2006-01-25 Thread Max Battcher
Jason Davies wrote: ALTER TABLE auth_groups ALTER id SET DEFAULT nextval('public.auth_group_id_seq'::text); This was the peculiar incantation I was looking for, thanks. Now I just have a non-fatal, non-blocking error from the django_content_types table... -- --Max Battc

magic_removal table update

2006-01-25 Thread Max Battcher
he sequences in PostgreSQL that I've overlooked? Otherwise, I'm assuming: * Dump the data to a file * Drop Cascade everything * Re-install * Import back from the file I made a brief remark on the wiki page that someone should probably amplify into some better general migration guideline.

Re: proper use of admin screens

2006-01-23 Thread Max Battcher
t more intricate than add/change permissions. If you give someone change permission to one of your models they can change any and all data in that table. Most likely you are going to want to roll your own, as you can be a lot more precise with your own code, but feel free to evaluate your own situa

Re: Admin functionality available on public site

2006-01-19 Thread Max Battcher
Views: http://www.djangoproject.com/documentation/generic_views/#using-create-update-delete-generic-views Mix and match these two in a good cocktail sauce and you have admin-style ui forms ala django. (Mmm, tasty.) -- --Max Battcher-- http://www.worldmaker.net/

Re: Preserving data through db updates/changes

2006-01-19 Thread Max Battcher
7;my_field_name')``, then you can think about things like ``add_field()`` or ``update_field()``. With those even cooler migration scripts could be built, and it could make it real quick to update a database from the Python console. Those are my thoughts at the moment, feel fre

Re: create object method

2006-01-16 Thread Max Battcher
thers. I had enough problems dealing with the magic that I went ahead and moved my development to magic-removal... See http://code.djangoproject.com/wiki/RemovingTheMagic -- --Max Battcher-- http://www.worldmaker.net/ "History bleeds for tomorrow / for us to realize and never more fol