Hello Daniel,
I think you really need to provide your definition of "nicer" to get
useful feedback.
For instance, my implementation of breadcrumbs[1] indeed introduces a
custom template tag and I haven't the slightest idea what are the use
cases where this approach would not be natural.
[1] http
> How can I override slugify function globally? I want to add some other
> letters actions especially form my language.
You can try django-autoslug for your own code. Existing code can be
(?) fixed via monkey-patching but that's not a good idea.
--
You received this message because you are subsc
Hi,
> I'm a little concerned by django error handling.
you could try the Werkzeug debugger[1], it really does save time a
lot. Or, by the way, you could try Werkzeug without Django, in some
cases it's a good idea.
There are many good frameworks, I suggest that you pick the language
first and then
Hi Sameer,
> is it possible to build a dynamic model in run-time in version 1.1 ?
What do you mean by "dynamic"? If you need to define arbitrary
attributes in runtime *and* be able to save them correctly in a RDBMS
*and* be able to restore the object from the DB *and* be able to query
objects by
I would suggest using django-navigation or a similar approach, that is
to bind breadcrumbs-related code to views instead of templates. Of
course you would still render the breadcrumbs in a template, but that
would be a single piece of code (I usually place it right in the
project's base.html) which
Why not create a symlink to django-tagging/tagging in the project
directory? I think it's the easiest way.
--
regards,
Andy
--
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
The problem is not in templates. Probably either a view or a template
tag does something wrong to the caption string. If Django hides the
traceback, try testing each module separately. The simplest way to
evade the "raise wrapped" is to raise an exception right _before_
rendering data prepared by y
I usually start with defining goals, actors and use cases, continue
with UML class diagrams and UI mockups on paper, and then transfer all
that to Python in this order: models, urls, views, templates. Then I
manually populate the DB with some data, dump a fixture and
periodically reset the app dat
Another way is to use a settings wrapper such as django-harness[1],
which:
* helps organize apps (by name, without the notion of project) and
eliminates the need to write absolute paths for templates, sqlite
database and such stuff stored in the project directory;
* simplifies version control of p
Try signals[1], namely pre_save[2]. I would stick to this way instead
of overriding model's save() method.
[1] http://docs.djangoproject.com/en/dev/topics/signals/
[2]
http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.pre_save
On Sep 1, 4:21 pm, Harish wrote:
> Hi Frie
Thanks for this excellent software!
--
Andy
--~--~-~--~~~---~--~~
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 from this group, sen
There's a sample project[1] in the github repo.
[1] http://github.com/jtauber/django-email-confirmation/tree/master/devproject
On Jul 25, 6:35 pm, kk wrote:
> Hi,
>
> Is there any tutorial document about how to use this module?
--~--~-~--~~~---~--~~
You received
Just one more addition to the replies above: there's a number of
snippets[1], recipes and packages[2] which introduce purely
autogenerated safe (unique and sometimes also non-ascii-friendly)
slugs without using admin.
Autopopulated slugs, when used in URLs without exposing internal
autoincremente
Django itself is extremely well documented. Sure there are some 3rd-
party applications without proper documentation, but I can't actually
recall one. Usually you can just read the code and figure out what it
does and how to use it. If you can't, see related code in Django
source or related topic
I used to use a skeleton, but the problem was that I couldn't easily
upgrade the already "forked" projects to a newer version of the
skeleton; I had to manually backport all changed to each project.
The solution I finally adopted is to have a wrapper for site
configuration (settings and urls) as
User behaviour can be formalized as actions + objects. Some actions
span multiple objects.
Admin is a great tool that corresponds the *structure* of data. It
allows to view and edit all your base for great justice. Err, all your
database for zero cost. Out of the box. Nice!
However, "editing an ob
Built-in template tag {% spaceless %) can do a part of work for you
(namely, remove the extra whitespace), but to actually obfuscate the
code you should either use middleware or make extensive use of
JavaScript (e.g. open GMail and try to read the source). However, the
idea in general sounds stran
What about using emails or openIDs for authentication? These include
namespaces per se ;)
On May 20, 1:09 am, Timboy wrote:
> Initially we will have in the ballpark of 10,000 Private users. Anyone
> have an idea on an additional user namespace?
>
> On May 19, 8:42 am, Aneesh wrote:
>
> > How ma
> Any aggregation over generic relations is currently unsupported, it was
> hoped this would make it into 1.1, but unfortunately some of the way SQL
> works prevented this (since it requires us to change the underlying Query to
> allow support for additional conditions on a join clause).
Alex, th
> I am but what parameter do I give to Count? My entity model don't have
> a comments field it is just connected through the view where I do {%
> load comments %}?
Immediately after posting my comment I understood that you actually
can do that easily:
Entry.objects.annotate(cc=Count('comment
> I am but what parameter do I give to Count? My entity model don't have
> a comments field it is just connected through the view where I do {%
> load comments %}?
Marlun, despite I can't reply to your question (no idea if sorting by
generic relations is possible; would be great to hear a respons
I mostly stick to defensive programming so rarely does the need to
debug appear; if it does, I use simple print commands to find the
stage on which the data is broken; then I fix the algo or add another
assert statement. This enables using Kate (or whatever text editor) +
manage.py for everything.
Hi,
> in register dispatcher.connect(pre_save,
> signal=model_signals.pre_save, sender=modem)
> AttributeError: 'module' object has no attribute 'connect'
Looks like it's time to update your Django installation.
regards,
Andy
--~--~-~--~~~---~--~~
You received t
The easiest way is probably to use something like django-gravatar[1].
Not only you can avoid writing extra models/views, but your site will
also reuse existing avatars for some users because Gravatar utilizes
email as use ID. So you'll only have to add one tag to your template:
{% for comment in
Hi, your question does not seem to be related to Django. Anyway:
class A:
cnt = 0
def __init__(self):
A.cnt += 1
If you want to count saved instances of a Django model, use
MyModel.objects.count().
Cheers,
Andy
--~--~-~--~~~---~--~~
You received
http://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey
class Section(Model):
...
parent = models.ForeignKey('self')
plus some code to build the string representing the path.
On Apr 21, 1:30 pm, Oleg Oltar wrote:
> Hi!
> I am writing an application - a kind of article manage
> How should I go about moving the site onto the django platform?
Learn Python, then Django. This implies reading lots of documentation
and being really interested in the whole thing. Also, you should try
to understand your needs before asking questions about how to address
them. Do you need just
As Daniel suggested, try tools like django_evolution. With the latter
you just do:
$ ./manage.py evolve --hint -x
This shows the changes to be made (--hint) and executes the migration
(-x). That's it, the table structure is now synchronized to the Python
class without the "alter table" pain.
--~
Zeal, the issue in its current state seems to be unrelated to Django.
By the way, do you really need to display so many objects on one page?
Why not try pagination?
Regards,
Andy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Go
29 matches
Mail list logo