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
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
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.)
--
--
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
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--
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
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
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
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
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
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
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
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:
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
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
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
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
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
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
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
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
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
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
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
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
--~--~-~--~~-
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
--~--~-~--~~--
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
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
, 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)
--~--~-~--~~---
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
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
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
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
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
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
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
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!" -
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
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
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
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
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
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)
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
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
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'
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"
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/
--~--~-~--~~-
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
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
-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
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/
--~--~-~--~~~---~-
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
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/
ally. It is it "too much" logic, and that is in some
way an aesthetic judgment.
--
--Max Battcher--
http://www.worldmaker.net/
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
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
ource under the LGPL.
--
--Max Battcher--
http://www.worldmaker.net/
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/
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/
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/
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/
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/
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/
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
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
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.
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
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/
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
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
71 matches
Mail list logo