Enter a contest to win a free e-copy of "Web Development with Django Cookbook"

2014-11-05 Thread Aidas Bendoraitis
Hello all, Not long ago my book "Web Development with Django Cookbook" was published and now you have a chance to win a free copy of it. Check http://djangotricks.blogspot.de/2014/11/win-free-copies-of-web-development-with-django-cookbook.html for more details. Cheers, Aidas B

Design question: User vs. UserProfile

2009-09-18 Thread Aidas Bendoraitis
e the AUTH_PROFILE_MODULE at any time. And with the second one you could change the authentication mechanism easier or allow records of people without Users. What do you usually choose? Kind regards, Aidas Bendoraitis --~--~-~--~~~---~--~~ You received this message because yo

Site structure and navigation

2009-05-06 Thread Aidas Bendoraitis
different models laying under each of them. Regards, Aidas Bendoraitis --~--~-~--~~~---~--~~ 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 u

Re: Comma instead of dot in FloatField

2009-04-17 Thread Aidas Bendoraitis [aka Archatas]
defaults.update(kwargs) return super(FloatField, self).formfield(**defaults) Regards, Aidas Bendoraitis On Apr 17, 9:04 am, Knut Nesheim wrote: > Hi all, > > I have a model with several FloatFields. Based on this, ModelForm   > creates some form.FloatFields.These fields

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Aidas Bendoraitis [aka Archatas]
> /products/?action=add > /products/?action=print > /products/?action=rss > /products/myproduct/?action=rss > /products/myproduct/?action=print > Those are examples of ugly (not clean anymore) urls. In such a case, you would need to have a wrapper view in Django, which would return the results of

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Aidas Bendoraitis [aka Archatas]
> 8. Using parameters >      /products/?sort=popularity >      /products/?filter=featured >      /products/?page=5 >      /products/add/ >      /products/myproduct/ >      /products/myanotherproduct/ In this case, you still need to have a black list of words like "add", "export", "print", "rss",

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Aidas Bendoraitis [aka Archatas]
Here are the advantages and disadvantages I see myself: > 1. One of the approaches is to use special symbols for the controlling > words, which are not allowed in slugs, like in last.fm or wikipedia > does. (+) url rules for the app might be defined in a separate file (+) shortness (-) unusual/un

Clean URL Design: List Views and Details Views

2009-04-16 Thread Aidas Bendoraitis
Hello, Recently, we are solving a conceptual question of designing clean urls for list and detail views of objects with slugs. Let's say we have products with their slugs. In the naive way, the list view could be accessed by /products/ and the detail views could be accessed by /products/

Escaping or Unescaping Translations in Templates

2008-08-29 Thread Aidas Bendoraitis
Hello all! How to control the escaping of translations in templates? For example, {% trans "I & Co" %} should be escaped in html templates but not in javascript (or other language) templates. Aidas Bendoraitis aka Archatas --~--~-~--~~~---~--~~ You

Re: Reusable models?

2008-05-22 Thread Aidas Bendoraitis
Your suggestions are welcome. Aidas Bendoraitis [aka Archatas] --~--~-~--~~~---~--~~ 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

Reusable models?

2008-05-21 Thread Aidas Bendoraitis
tices for reusing models? Regards, Aidas Bendoraitis [aka Archatas] --~--~-~--~~~---~--~~ 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

Re: The setlang view

2007-09-24 Thread Aidas Bendoraitis
Or you can have a form with an for each language. Regards, Aidas Bendoraitis [aka Archatas] On 9/24/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Sun, 2007-09-23 at 18:13 +0100, Chris Hoeppner wrote: > [...] > > Seems pretty silly to me. I know that any request

Backwards relationship doesn't work on one of the development machines

2007-09-18 Thread Aidas Bendoraitis
Regards, Aidas Bendoraitis [aka Archatas] --~--~-~--~~~---~--~~ 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 g

Re: How do I pull a javascript array into a form submission

2007-09-18 Thread Aidas Bendoraitis
some field which holds the number of dynamically created input fields. Whenever a user submits the form, you check the number of dynamically created fields and create a form with the number of those dynamic fields. Regards, Aidas Bendoraitis [aka Archatas] On 9/4/07, eriku777 <[EMAIL PROTECTED

Re: using defaultdict on django

2007-09-03 Thread Aidas Bendoraitis
keys and values Regards, Aidas Bendoraitis aka Archatas On 8/25/07, james_027 <[EMAIL PROTECTED]> wrote: > > Hi, > > Anybody has an idea about this? > > Thanks > james > > On Aug 24, 3:27 pm, james_027 <[EMAIL PROTECTED]> wrote: > > hi, > > >

Re: How to pass an extra variable to every template?

2007-08-23 Thread Aidas Bendoraitis
quot;, "django.core.context_processors.request", "yourproject.yourapp.context_processors.general", ) >From now on {{ root_dir }} and {{ media_url }} will be accessible in all templates. Good luck! Aidas Bendoraitis [aka Archatas] On 8/23/07, Filipe Correia <[EMAIL PROT

Re: Importing Excel/CVS into Database

2007-08-21 Thread Aidas Bendoraitis
reader = csv.reader(line_list, delimiter=";", doublequote=True) for value_list in reader: function(value_list) >>> read_excel_csv("/some/path/table.csv", test) ### Good luck! Aidas Bendoraitis aka Archatas On 8/21/07, olivier <[EMAIL PROTECTED]>

Re: Can Django be combined with a more powerful ORM?

2007-08-20 Thread Aidas Bendoraitis
tribute, 0) setattr(self, attribute, current_value + by_value) self.save() Good luck! Aidas Bendoraitis [aka Archatas] On 8/20/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Mon, 2007-08-20 at 15:48 +0200, Stefan Matthias Aust wrote: > [...] > > I'd li

Re: Multiple Edit

2007-08-16 Thread Aidas Bendoraitis
Christopher, In your case, I would create a custom view/form extending the templates of admin and would set the url of that view to something like r'^/admin/obj_list/$'. Regards, Aidas Bendoraitis [aka Archatas] On 7/21/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > &

Re: DRY violation

2007-07-11 Thread Aidas Bendoraitis
# ... assign the user to the instance if it has the created_by field ... dispatcher.connect(attach_user_to_object, signal=signals.pre_save) Regards, Aidas Bendoraitis On 7/11/07, Norjee <[EMAIL PROTECTED]> wrote: > > Use the events framework. I'm sure there is a pre-save e

Re: about django-admin settings

2007-07-08 Thread Aidas Bendoraitis
Set the environment variable PYTHONPATH to the parent directory of the mysite. That should help you. Regards, Aidas Bendoraitis aka Archatas On 7/9/07, jujian <[EMAIL PROTECTED]> wrote: > > HELP! > > > > > --~--~-~--~~~---~--~

Re: Djangonauts at EuroPython?

2007-07-08 Thread Aidas Bendoraitis
I don't participate in the EuroPython this year, but have fun in the capital of my native country :) Regards, Aidas Bendoraitis aka Archatas (from Berlin, Germany) On 7/8/07, Ville Säävuori <[EMAIL PROTECTED]> wrote: > > > Simon Willison is keynoting, and he is an origina

Re: function to generate choices list

2007-07-08 Thread Aidas Bendoraitis
I think, the problem would be solved if you assigned a class overriding list instead of a preformed list to the choices. Check XFieldList for a living example: http://www.djangosnippets.org/snippets/51/ Regards, Aidas Bendoraitis aka Archatas On 7/6/07, David Reynolds <[EMAIL PROTEC

Re: augmenting admin delete

2007-07-04 Thread Aidas Bendoraitis
Use Django pre_delete and post_delete signals: http://www.mercurytide.co.uk/whitepapers/django-signals/ or override the delete method: def delete(self): # do something super(type(self), self).delete() # do something Regards, Aidas Bendoraitis aka Archatas On 7/3/07, Bryan <[EM

Re: Send a filter-pipline output to a template tag

2007-06-26 Thread Aidas Bendoraitis
Use the {% with %} template tag for that: {% with variable|some_filter as some_list %} {% for el in some_list %} {% do_something el %} {% endfor %} {% endwith %} Regards, Aidas Bendoraitis aka Archatas On 6/25/07, Manuel Meyer <[EMAIL PROTECTED]> wrote: > > -BEGI

Re: How to put an asterisk next to the required form fields?

2007-06-25 Thread Aidas Bendoraitis
For the oldforms, it should be like this: {%for field in form%} {{ field.label }} {{ field }}{%if field.formfield.is_required %}*{%endif%} {%endfor%} tag is deprecated. DO NOT use it. Use CSS. Regards, Aidas Bendoraitis aka Archatas On 6/25/07, EL AATIFI Sidi

Re: using recaptcha with django's contrib comments module

2007-06-25 Thread Aidas Bendoraitis
the world, but it works. Regards, Aidas Bendoraitis aka Archatas On 6/23/07, Eric St-Jean <[EMAIL PROTECTED]> wrote: > > Hi, > > Short form of my question: i have a custom view which does some work and > then calls django.contrib.comments.views.comments.post_free_comment;

Re: How reliable is using Ajax?

2007-06-21 Thread Aidas Bendoraitis
as stable as you make it, as well as any other technologies. Regards, Aidas Bendoraitis aka Archatas On 6/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I have been tinkering with Ajax today, based on this tutorial: > http://www.b-list.org/weblog/2006/07/31/django-tips-simp

Re: classes

2007-06-21 Thread Aidas Bendoraitis
Actually, type is a function, not a method. type(x) == x.__class__ Regards, Aidas Bendoraitis aka Archatas On 6/18/07, Joseph Heck <[EMAIL PROTECTED]> wrote: > > x = '123' > x.__class__ will give a reasonable answer, x.type() doesn't. (Python 2.4) > >

Re: classes

2007-06-18 Thread Aidas Bendoraitis
or type() On 6/7/07, Joseph Heck <[EMAIL PROTECTED]> wrote: > > .__class__ > > On 6/7/07, Lic. José M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote: > > how can I know insede a method the type of my class dynamicaly? > > > > -- > > Lic. José M. Rodriguez Bacallao > > Cupet > > > > > > > > > --~

Re: Using Ajax to edit my admin page

2007-06-18 Thread Aidas Bendoraitis
plate tag which would return a complex array structure with manufacturers and corresponding collections. Regards, Aidas Bendoraitis aka Archatas On 6/7/07, Greg <[EMAIL PROTECTED]> wrote: > > I'm building a site where I'm going to have 10 manufacturers and each > of t

Re: Simple Template Dict Problem

2007-06-18 Thread Aidas Bendoraitis
Hello Trey! You can iterate by the entries of a dictionary, using this: {% for i in d.items %} {{ i.0 }}: {{ i.1 }} {% endfor %} Regards, Aidas Bendoraitis aka Archatas On 6/7/07, Trey <[EMAIL PROTECTED]> wrote: > > Thanks Russ, I think my answer for today is three dimen

Re: {{ perms }} seems to be empty

2007-05-23 Thread Aidas Bendoraitis
Is "django.core.context_processors.auth" set in your TEMPLATE_CONTEXT_PROCESSORS? Are those new custom permissions in the auth_permission table? If not - try to delete the test tables and syncdb again. Regards, Aidas Bendoraitis aka Archatas On 5/23/07, Michael Lake <[EMAIL PROT

Re: Securing static files

2007-05-18 Thread Aidas Bendoraitis
The most secure way, in my opinion, is to keep the files in a directory which is not accessible via the webserver and write a wrapper view, which would return the static files if the user within the current session has appropriate permissions. Regards, Aidas Bendoraitis aka Archatas On 5/18

Re: nested dictionaries in templates

2007-05-17 Thread Aidas Bendoraitis
except: return None register.filter('dict_value', dict_value) ... or you can go through the items like this: {% for key_value in dictionary.items %} {{ key_value.0 }}{# the key #} {% for item in key_value.1 %}{# the value, that is the queryset #} {{ item }} {% endfor %}

Re: Tricky context question

2007-05-15 Thread Aidas Bendoraitis
This should help you to solve almost all your multilingual problems: http://www.djangosnippets.org/snippets/51/ Regards, Aidas Bendoraitis aka Archatas On 5/15/07, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > > I have a bi-language (english and german) site. I try to hide the >

Re: excel import

2007-05-14 Thread Aidas Bendoraitis
to the record of the main item. All the further details depend on your models and business requirements. Regards, Aidas Bendoraitis aka Archatas On 5/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello, everyone! > > I want to implement some sort of importing data int

Re: Translation of class names

2007-05-10 Thread Aidas Bendoraitis
Maybe you are calling make-messages from the wrong directory, or Russian is not in the LANGUAGES? Regards, Aidas Bendoraitis aka Archatas On 5/8/07, Pashka R. <[EMAIL PROTECTED]> wrote: > 2007/5/7, Konstantin Pavlovsky <[EMAIL PROTECTED]>: > > > > up! > > nobod

Re: Dev Server - Being Denied Admin Media

2007-05-08 Thread Aidas Bendoraitis
Bryan, If this happens when using django integrated dev server, then setting ADMIN_MEDIA_PREFIX to something different than MEDIA_URL should help you, for example: "admin-media". I consider this a bug of Django, which perhaps appear only under some specific conditions. Aidas Bendor

Re: django sendmail

2007-04-26 Thread Aidas Bendoraitis
Set some EMAIL_HOST, EMAIL_HOST_USER, and EMAIL_HOST_PASSWORD in your settings. That might help you. Regards, Aidas Bendoraitis aka Archatas On 4/26/07, arv43 <[EMAIL PROTECTED]> wrote: > > hello, > i get a 550, relay not permitted error when i try to use send_mail. > th

Re: Per-object-permission branch and Many-to-many relationship issue

2007-04-05 Thread Aidas Bendoraitis
where=['categoryapp_category.id=eec.category_id', 'eec.element_id=%d' % (self.id or 0)], ) Now I can use e.get_categories() instead of e.categories.all() and get the related objects without errors. Regards, Aidas Bendoraitis [aka Archatas] On 4/4/07, Aidas Bendoraitis <[EMAIL PRO

Re: Hacking admin changes

2007-04-04 Thread Aidas Bendoraitis
I would have written a request_middleware instead of what you did. I think, it would be cleaner. Regards, Aidas Bendoraitis [aka Archatas] On 4/4/07, Enrico <[EMAIL PROTECTED]> wrote: > > Can't you just override the 'save' method of your model? > > Or may

Per-object-permission branch and Many-to-many relationship issue

2007-04-04 Thread Aidas Bendoraitis
e circumventing of the problem, that is, how could I get all the categories for the Element instance? By the way, I tried to import models both: using project name and not using it. The results are the same. I am using MySQL if it may matter. Has anybody experienced the problem using the

Re: Using a ForeignKey in ordering

2007-04-04 Thread Aidas Bendoraitis
correcting myself: a) Page.objects.order_by('menuitem__name') --> Page.objects.select_related().order_by('menu_menuitem.name') Regards, Aidas Bendoraitis [aka Archatas] On 4/4/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > As far as I know, current

Re: Using a ForeignKey in ordering

2007-04-04 Thread Aidas Bendoraitis
te some template tag which reorders items according some conditions and override the change_list.html template for the page model. Regards, Aidas Bendoraitis [aka Archatas] On 4/4/07, James Turnbull <[EMAIL PROTECTED]> wrote: > > Thanks Atilla, > > > There was a simmilar ques

Re: Differentiate addition or change during post_save signal

2007-04-04 Thread Aidas Bendoraitis
You can have a pre_save signal for adding property instance._is_new=True if the instance has no id. And then to delete that property in the post_save signal after checking it. Regards, Aidas Bendoraitis [aka Archatas] On 4/4/07, David Larlet <[EMAIL PROTECTED]> wrote: > > Hi, >

Re: Python-specific question: variable scope

2007-03-30 Thread Aidas Bendoraitis
It's not strongly related to some specific problem, but more to the better python perception and self-training. Thank you all for your time and attention. Thank you, Jerremy D, for the interesting solutions. Regards, Aidas Bendoraitis [aka Archatas] On 3/31/07, Forest Bond <[EMAIL P

Re: Python-specific question: variable scope

2007-03-30 Thread Aidas Bendoraitis
e is a blackbox to me def get_the_x_of_the_module_which_is_importing_me(): return #??? Regards, Aidas Bendoraitis [aka Archatas] P.S. If I am not understandable because of "strange" English, it might be that I need some coffee or sleep. :) On 3/30/07, Rubic <[EMAIL PROTECTED]> wrote: > > b.py: > -

Re: Python-specific question: variable scope

2007-03-30 Thread Aidas Bendoraitis
se it with the context of the current one, like include statement in PHP? If there are no ways to do that, then I will just use some workarounds. At first, I am interested about possibilities. Regards, Aidas Bendoraitis aka Archatas On 3/30/07, Forest Bond <[EMAIL PROTECTED]> wrote: > O

Python-specific question: variable scope

2007-03-30 Thread Aidas Bendoraitis
module a.py in the module b.py? What would be the functions/statements to make it possible? Or in general, how to access the locals of the importing ( not imported!!!) module? Regards, Aidas Bendoraitis --~--~-~--~~~---~--~~ You received this message because you are

Re: Django and Routing SUBDOMAIN STYLE URL

2007-03-24 Thread Aidas Bendoraitis
return None My settings variables: ROOT_DIR - either "/" or "/projectname/" depending on how my project is accessed - under some domain directly or in some directory of localhost. SUBDOMAINS_SUPPORTED - Are subdomains supported on that server? True/False SUBDOMAIN_MN

Re: adding to User class

2007-03-22 Thread Aidas Bendoraitis
; You can access the custom method like this: user.get_profile().dosomething() Regards, Aidas Bendoraitis [aka Archatas] On 3/22/07, Greg Donald <[EMAIL PROTECTED]> wrote: > > How/where can I add a method to the built-in User class? > > > Thanks, > > >

Re: Always repeating myself in templates

2007-03-22 Thread Aidas Bendoraitis
Then instead of {{ object.whatever.whatever.property }}, you can use {{ object.get_related_property }} and even if you do that multiple times, the database is accessed only at the first time of accessing the method. Regards Aidas Bendoraitis aka Archatas On 3/22/07, akonsu <[EMAIL PROTECTED]> wrote: > > hello, > &g

Re: Development in LAN. URLs of FlatPages. Best Practices?

2007-03-21 Thread Aidas Bendoraitis
Ashwoods, I did also some other business-related modifications so it would take me some time to prepare that just for a snippet. That middleware is not worth making it a snippet. I would better suggest you to use the solution by Derek. Regards, Aidas Bendoraitis [aka Archatas] On 3/21/07

Re: Blocking IP with middleware?

2007-03-21 Thread Aidas Bendoraitis
Check the request.META['REMOTE_ADDR'] in your custom request middleware. If it equals to the one, you want to block, return an error page. Regards, Aidas Bendoraitis [aka Archatas] On 3/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Looking at my logs, I saw a g

Re: Development in LAN. URLs of FlatPages. Best Practices?

2007-03-20 Thread Aidas Bendoraitis
ether you're talking about models, views, middleware, or something else from the flatpages. Anyway, it's enough to write your own middleware to override the default control of the flatpages (And fortunately it is not hard to do that). Regards, Aidas Bendoraitis [aka Archatas] > >

Re: Subversion: How do you set up multiple branches of the same project on the same machine?

2007-03-20 Thread Aidas Bendoraitis
" SetEnv DJANGO_SETTINGS_MODULE someproject.settings PythonDebug On PythonAutoReload On PythonInterpreter someproject2 I also symlink media directories respectively to someproject-media and someproject2-media in Apache htdocs. Anyway, thanks, Scott, for your help as well.

Re: SESSION_EXPIRE

2007-03-19 Thread Aidas Bendoraitis
Two things, that might be the cause of your problem: a) Have you restarted your browser or at least removed settings.pyc after the changes? b) If you use Mac OS and you close the window of your browser, the browser itself isn't closed. Press Cmd+Q to close the browser completely. Regards,

Re: Subversion: How do you set up multiple branches of the same project on the same machine?

2007-03-19 Thread Aidas Bendoraitis
-permission branch. They are like one project at different statuses and at some point they'll need to be merged (at least some parts of them). Both someproject and someproject2 are self-contained projects. No other project uses any part of them. Regards, Aidas Bendoraitis [aka Archatas] On 3/

Subversion: How do you set up multiple branches of the same project on the same machine?

2007-03-19 Thread Aidas Bendoraitis
in that case I won't be able to merge the branch back to the project, will I? How do you solve problems like that, or how could I deal with it instead of renaming the project? Regards, Aidas Bendoraitis [aka Archatas] --~--~-~--~~~---~--~~ You received

Re: Checking whether an app is installed?

2007-03-14 Thread Aidas Bendoraitis
. show links to administration lists ... {% endif %} But thanks, anyway. Regards, Aidas Bendoraitis [aka Archatas] On 3/14/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 3/14/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > > Is there a function for checking whether

Checking whether an app is installed?

2007-03-14 Thread Aidas Bendoraitis
Hello, Djangoers! Is there a function for checking whether an app was installed in the current project? I have a custom index.html template for contributed administration and I need to check whether to show some links or not. Regards, Aidas Bendoraitis [aka Archatas

Re: why does django display th/td:hover style incorrectly ?

2007-03-14 Thread Aidas Bendoraitis
I'm not sure about IE7, but all the previous versions of IE certainly didn't support hover for other html tags than . So it is not Django issue at all. If you need some browser specific special effects, use javascript for IE. Regards, Aidas Bendoraitis [aka Archatas] On 3/14/07, Ou

Re: High Fidelity Slugify : support for international characters

2007-03-12 Thread Aidas Bendoraitis
(maybe better) as an extension suggestion for http://www.djangosnippets.org/snippets/98/ Regards, Aidas Bendoraitis [aka Archatas] On 3/12/07, Sam <[EMAIL PROTECTED]> wrote: > > I needed slugify to be more precise with accented characters and i > couldn't find some code to

Re: howto add join table field?

2007-03-09 Thread Aidas Bendoraitis
= model.ForeignKey(Item) itemlist = model.ForeignKey(ItemList) You won't be able to use the default admin widget for Many to many selection (at least without some template ant javascript hacking), but you'll have what you want. Regards, Aidas Bendoraitis [aka Archatas] On 3/9/07, akon

Re: Admin interface

2007-03-08 Thread Aidas Bendoraitis
Either override templates for specific models or use javascript (js property of the Admin class) to change the fields. I think that it will be also possible to change the field type with the newforms admin. Reference: http://www.djangosnippets.org/snippets/35/ Good luck! Aidas Bendoraitis [aka

Re: Signals for User model

2007-03-07 Thread Aidas Bendoraitis
mind is: How to attach an attribute, property or method to an existing Python class? Any examples or directions? Regards, Aidas Bendoraitis [aka Archatas] On 3/7/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Wed, 2007-03-07 at 11:58 +0100, Aidas Bendoraitis wrote: > &g

Signals for User model

2007-03-07 Thread Aidas Bendoraitis
modify the contributed models and the code was read and executed when the user is saved? Regards, Aidas Bendoraitis [aka Archatas] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to th

Re: can I mimic authenticated user from shell?

2007-03-06 Thread Aidas Bendoraitis
Can't help you much with this, but according to the docs (http://www.djangoproject.com/documentation/authentication/#methods), "is_authenticated() -- Always returns True" for User model and it returns False for AnonymousUser model. Regards, Aidas Bendoraitis [aka Archat

Re: Outputting navigation

2007-03-05 Thread Aidas Bendoraitis
ndfor %} {% endfor %} Regards, Aidas Bendoraitis [aka Archatas] On 3/5/07, Mike H <[EMAIL PROTECTED]> wrote: > > > Hi all, > > I have a list of wiki pages, each one has a category. > > I want to output them in a list, grouped by category. > > So far I am looping thr

Re: creating a website log

2007-03-05 Thread Aidas Bendoraitis
Maybe this could help you: http://www.djangosnippets.org/snippets/16/ Regards, Aidas Bendoraitis [aka Archatas] On 3/3/07, Patrick <[EMAIL PROTECTED]> wrote: > > Hi, I'd like to create a website log, similar to the log found in > django.contrib.admin and was wondering i

Re: Recursion in templates... again

2007-03-05 Thread Aidas Bendoraitis
%} {{ item }} {% menu item %} {% endfor %} {% endif %} Regards, Aidas Bendoraitis [aka Archatas] On 3/5/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Mon, 2007-03-05 at 10:31 +0100, Jens Diemer wrote: > > Chris Moffitt schrieb: > > > I've implemented a s

Development in LAN. URLs of FlatPages. Best Practices?

2007-03-05 Thread Aidas Bendoraitis
ther under local domain names (i.e. http://example.local/). 3. creating some middleware that removes directory name from the requested URL before URL parsing. What are the best practices for doing that? What do you do in similar situations? Regards, Aidas Bendoraitis [ak

Re: selecting site from hostname in URL

2007-03-01 Thread Aidas Bendoraitis
parse the URL and and get appropriate content according the subdomain. Regards, Aidas Bendoraitis [aka Archatas] On 3/1/07, Doug Van Horn <[EMAIL PROTECTED]> wrote: > > On Feb 28, 6:33 pm, Michael Cuddy <[EMAIL PROTECTED]> wrote: > > > > Any ideas? > > -- > &g

Re: Django apps

2007-03-01 Thread Aidas Bendoraitis
Have a look here: http://code.djangoproject.com/wiki/DjangoResources#ExampleDjangoapplicationswithsourcecodetemplates Regards, Aidas Bendoraitis [aka Archatas] On 2/28/07, Alessandro Ronchi <[EMAIL PROTECTED]> wrote: > > Is there any place where I can find django based apps? >

Re: database field

2007-02-27 Thread Aidas Bendoraitis
I think, overriding the admin template for specific application would be the most straightforward solution: * create a template in your template dir admin/yourapp/change_form.html * show some field there only if request.user has some permissions. Regards, Aidas Bendoraitis [aka Archatas] On 2

Re: where is the code for the date widget in admin

2007-02-27 Thread Aidas Bendoraitis
like FireBug for Firefox (or at least use "view source"). Good luck! Aidas Bendoraitis [aka Archatas] On 2/24/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Sat, 2007-02-24 at 13:13 +0530, Kenneth Gonsalves wrote: > > > > On 24-Feb-07, at 12:22 PM, oggie r

Re: Search feature

2007-02-23 Thread Aidas Bendoraitis
cts.filter(*flatpage_args, **flatpage_kwargs) product_args = ... # OR'ed arguments product_kwargs = ... # arguments to AND products = Product.objects.filter(*product_args, **product_kwargs) Regards, Aidas Bendoraitis [aka Archatas] On 2/22/07, Mary <[EMAIL PROTECTED]> wrote: >

Re: Seeking best-practices: modular site hosting multiple URLs

2007-02-23 Thread Aidas Bendoraitis
What you need in my opinion is just one django project with multiple settings files (for each domain). Regards, Aidas Bendoraitis [aka Archatas] On 2/21/07, Sundial Services <[EMAIL PROTECTED]> wrote: > > I would like to find references to "best practices" regarding t

Re: sorting in model

2007-02-19 Thread Aidas Bendoraitis
You can't order by a property of a model, but you can do that by the field of the related model: Film.objects.select_related().order_by('appname_product.name') Documentation: http://www.djangoproject.com/documentation/db_api/#order-by-fields Regards, Aidas Bendoraitis [aka Arch

Re: Django Cheat Sheet

2007-02-14 Thread Aidas Bendoraitis
I found one small mistake. CommaSeparatedIntegerField doesn't have auto_now and auto_now_add, so they should be removed from the appropriate place in the cheet sheet. Regards, Aidas Bendoraitis [aka Archatas] On 2/14/07, Julian Romero <[EMAIL PROTECTED]> wrote: > On 2/13/07, J

Re: Listing users

2007-02-14 Thread Aidas Bendoraitis
r__id')[offset:limit] Regards, Aidas Bendoraitis [aka Archatas] On 2/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a site with users and an additional user_profile to store extra > information like a signature, avatar, etc. > > I cannot fi

Re: How do you pass a variable to a template tag?

2007-02-13 Thread Aidas Bendoraitis
id) except ValueError: obj = None context[self.var_name] = obj return '' register.tag('load_obj', do_load_obj) # code ends here I think, this is a good example of both -- reading a value of a variable in a template tag and also set

Re: use forloop.counter0 as index?

2007-02-02 Thread Aidas Bendoraitis
ome other way and to get all the necessary values from that merged list. Good luck! Aidas Bendoraitis aka Archatas On 2/1/07, Brandon Warren <[EMAIL PROTECTED]> wrote: > > Hello, > > Is it possible to use forloop.counter0 as an index into a list? > > For example: &

Re: Multilingual content - yet another idea

2007-02-01 Thread Aidas Bendoraitis
Regarding the list of available languages, I think that the translation system should use the settings, provided by default (LANGUAGE_CODE and LANGUAGES) instead of ids or other list variables. http://www.djangoproject.com/documentation/settings/#language-code Regards, Aidas Bendoraitis On 2

Re: textarea - autoamtic line break

2007-01-29 Thread Aidas Bendoraitis
Line-break CSS property should help you here: http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/linebreak.asp However, it may not be supported by most browsers at the moment. Regards, Aidas Bendoraitis aka Archatas On 1/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>

verbose_name for apps?

2007-01-25 Thread Aidas Bendoraitis
Hello! Can somebody remind me, whether it is possible to set verbose names for a Django applications, so that these names would be shown at the index page of the contributed administration? How to do it if it is possible? Regards, Aidas Bendoraitis aka Archatas

Re: Multilingual content - yet another idea

2007-01-23 Thread Aidas Bendoraitis
This is exactly what I had in mind :) I am installing python, svn, and Django on my personal machine and will do a couple of experiments regarding multilingual content at my spare time the next days. Regards, Aidas Bendoraitis aka Archatas On 1/23/07, [EMAIL PROTECTED] <[EMAIL PROTEC

Re: Template with multiple elements and manipulators

2007-01-23 Thread Aidas Bendoraitis
ifferent action urls for different forms. You can have form1 as form2 as context variables just not to mix up the validation errors and prepopulated values. Good luck! Aidas Bendoraitis aka Archatas On 1/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I imagine it wo

Re: Multilingual content - yet another idea

2007-01-23 Thread Aidas Bendoraitis
;t be retrieved at all? Shouldn't the untranslated field just return an empty value and then the template could suggest a link to the original text reporting about the missing translation? Regards, Aidas Bendoraitis aka Archatas On 1/23/07, nesh <[EMAIL PROTECTED]> wrote: > &g

Re: Multilingual content - yet another idea

2007-01-23 Thread Aidas Bendoraitis
k=gst&q=Aidas+Translatable&rnum=1#de9ffbc0c79a3a17 Regards, Aidas Bendoraitis aka Archatas On 1/23/07, ashwoods <[EMAIL PROTECTED]> wrote: > > ah btw, thx marcin. but now i don't know what i am going to be doing in > febraury :) > > > On Jan 23, 10:29 am, &q

Re: syncdb: No module named Utils

2007-01-21 Thread Aidas Bendoraitis
Perhaps that framework uses some third-party libraries, that have to be installed onto your machine. You can find this out, full-text-searching for "Utils" in that project. Regards, Aidas Bendoraitis aka Archatas On 1/22/07, johnny <[EMAIL PROTECTED]> wrote: > > D

Re: Custom manipulator, default form?

2007-01-16 Thread Aidas Bendoraitis
the manipulator ... class MyModel(models.Model): AddManipulator = CustomAddManipulator ChangeManipulator = CustomChangeManipulator Good luck! Aidas Bendoraitis aka Archatas On 1/16/07, Rob Slotboom <[EMAIL PROTECTED]> wrote: For one of my models I need to do some extra vali

Re: Permissions at object instance level

2007-01-16 Thread Aidas Bendoraitis
like that in order to fasten the merging of this branch to the trunk? Regards, Aidas Bendoraitis aka Archatas On 1/16/07, Jay Parlar <[EMAIL PROTECTED]> wrote: On 1/15/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > The Row-Level-Permissions branch was (is) an attempt to

Re: new or old forms

2007-01-15 Thread Aidas Bendoraitis
the details like file uploads. Regards, Aidas Bendoraitis aka Archatas On 1/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi, I'm relatively new to django. I've installed django from the source repository. At the moment I'm considering use of newforms for my applica

Django Projects and Subversion

2007-01-10 Thread Aidas Bendoraitis
jango websites on the same server. So what is a better practice -- to use the code under source control for the public websites directly, or to have copies (tags) of the subversioned code for the public websites? How is this managed with djangoproject.com and djangobook.com? Regards, Aidas Bendoraiti

Re: model referencing itself

2007-01-05 Thread Aidas Bendoraitis
I think, you will also need related_name parameter for your relating fields. Regards, Aidas Bendoraitis aka Archatas On 1/5/07, Jorge Gajon <[EMAIL PROTECTED]> wrote: Hi Aljosa, On 1/4/07, Aljosa Mohorovic <[EMAIL PROTECTED]> wrote: > > i'm trying to create a

Re: Many-To-Many relationships, select_related()

2007-01-05 Thread Aidas Bendoraitis
custom SQL query to select the same thing -- the intermediate table, joining users and permissions, and then ordering by users. Regards, Aidas Bendoraitis aka Archatas On 1/3/07, Trey <[EMAIL PROTECTED]> wrote: Is there a problem in django's many-to-many relationship mapper when

Re: including a template in itself

2007-01-05 Thread Aidas Bendoraitis
level. Regards, Aidas Bendoraitis aka Archatas On 12/30/06, Rob Slotboom <[EMAIL PROTECTED]> wrote: I've a template which will be included. Within the template I want to include it again if needed. child_list.html {% if categorie %} {{ categorie.title }} {% if categorie.ch

Re: edit_inline disables slug prepopulation?

2007-01-05 Thread Aidas Bendoraitis
As far as I remember, It's not normally available for the fields of the inline-edited models. However, you can still add some custom JavaScript to the admin template to implement that functionality. Good luck! Aidas Bendoraitis aka Archatas On 12/27/06, ringemup <[EMAIL PROTECTED

  1   2   >