Re: creating an api using python

2010-12-04 Thread Robbington
There are lots of tutorials on creating api's using Django. If you are new to Python and Django start with the main Polls app on the main Django site: http://docs.djangoproject.com/en/dev/intro/tutorial01/ Otherwise, the best I can suggest is to google it: http://tinyurl.com/2umrbh6 -- You rece

Re: main categories in menu

2010-12-04 Thread Rob
> It sounds like you have 3 views, and each one can pick from a pool of > categories.  If this is correct, all you need to do is enter a line > for each view (main#), and pass the category (page#) as a variable to > the view, which can then do the lookup.  You will use something like: > Thanks fo

Re: how can I clean a form field before the clean method?

2010-12-04 Thread refreegrata
Yes, you have reason. I prefer use something like an "exclude" or "fields" tuple in the form meta, and set default values in the model to the fields that I need, but some of the default values are foreign keys. I want to do something like: .default = MyModel.objects.get(field=True) and raise

Re: Conflict trying to save models when roles metaclass is applied.

2010-12-04 Thread juacompe
Good idea! I'll try that and update the post. I'll be out of town for a week, don't think i can code during that. so my next post would be around the next weekend. Have a good day! Chokchai P. On Dec 4, 12:19 am, bruno desthuilliers wrote: > On 3 déc, 08:00, juacompe wrote: > > > Hi Bruno, > >

SV:RE: (--.

2010-12-04 Thread Rakesh Thakrar
Recently, I bought some presents from a commercial site for Christmas, all the products can enjoy a big discount, it is worth visiting: fallinele.com , for the Christmas more one choice. g--. -- You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: ORA-01425

2010-12-04 Thread Tim Sawyer
On 03/12/10 17:29, Ian wrote: On Dec 2, 3:17 pm, Tim Sawyer wrote: I unpatched mine (changed LIKEC to LIKE) and then ran: >>> from django.db import connection >>> cursor = connection.cursor() >>> result = cursor.execute(r"SELECT 1 FROM DUAL WHERE TRANSLATE('A' USING NCHAR_CS) LIKE TRA

Class based views list view logic

2010-12-04 Thread Recep KIRMIZI
Hi i m trying to use class based views on my project. I've read the documentation but i couldnt determine it well. what i'm trying to do is just use simple list of items of selected menu. i have 2 classes on my model. Menu and MenuItem. Menu corresponds of food menu types of a cafe; like "wine menu

Re: List compare is there something better than a double loop?

2010-12-04 Thread Sector7B
very cool thanks, i knew it was a lack of api knowledge on my part. On Dec 2, 10:53 pm, Aaron Sterling wrote: > > I'm building a store that has a product_list (class ProductList: > > store, name, description) that contains .products (class Product: > > name, description, price etc...) > > If you'

Re: List compare is there something better than a double loop?

2010-12-04 Thread bruno desthuilliers
On 3 déc, 04:42, Sector7B wrote: > Hi, I probably have a common problem and maybe i'm not thinking about > this correctly, but here it is. > > I'm building a store that has a product_list (class ProductList: > store, name, description) that contains .products (class Product: > name, description, p

Re: Class based views list view logic

2010-12-04 Thread Łukasz Rekucki
This example should help you: http://docs.djangoproject.com/en/dev/topics/class-based-views/#dynamic-filtering ``self.args`` and ``self.kwargs`` contain the groups matched in the URL, so I guess you want to use ``self.args[0]`` as your Menu name. One thing I don't understand is, why you sometimes

Re: how can I clean a form field before the clean method?

2010-12-04 Thread wayne
> I want to do something like: > > .default = MyModel.objects.get(field=True) > > and raise an exception if don't find in the table a row with a field = > True, but I don't have idea if something like this can be done. > I'm not always real good at understanding what someone wants. However, i

Re: main categories in menu

2010-12-04 Thread wayne
> So if a user enters mydomain.com/main1/page1 --> check if main1 exists > in the database --> render a menu of all pages which are linked to > main1 --> show page1 So, I take it that if the user enters the above, and main1 does not exist in the db, then you will raise an error (probably 404)? I

Re: main categories in menu

2010-12-04 Thread het.oosten
Thank you for explaining. This is indeed exact what I was looking for. I thought I could only pass one argument to the view. Rob On 4 dec, 18:32, wayne wrote: > > So if a user enters mydomain.com/main1/page1 --> check if main1 exists > > in the database --> render a menu of all pages which are

not able to see models.DecimalField in template

2010-12-04 Thread Patrick
I have 2 fields in my model: listing.name and listing.amount listing.name shows up in the template but listing.amount does not. Do I have to convert it to unicode first? Thanks, Patrick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: not able to see models.DecimalField in template

2010-12-04 Thread Wayne Smith
You shouldn't need to. How are you rendering your fields in your template? On Dec 4, 2010 1:21 PM, "Patrick" wrote: > I have 2 fields in my model: > listing.name and listing.amount > > listing.name shows up in the template but listing.amount does not. Do > I have to convert it to unicode first?

Re: not able to see models.DecimalField in template

2010-12-04 Thread delegbede
I really don't have an answer to the question. Instead of asking whether or not you should convert to unicode, I think you should have converted first to unicode and see what happens. If that doesn't work, then you ask for help. It is just normal that you've used up all options you can think

Re: how can I clean a form field before the clean method?

2010-12-04 Thread refreegrata
ok, thanks for the answer. I have a final question. The other way is in the __init__ set initial values in hidden fields, but if the user (malicious) edit the value in some of this fields the form is invalid, and the form comeback, but with the values edited for the user and the error messages. Can

Re: Project management software

2010-12-04 Thread tiemonster
Is that specifically for software development? For people looking for time tracking, SCRUM, etc, that might be a good option. I was looking to specifically develop project management software that business users can utilize to manage projects not necessarily related to software development. I want

Re: how can I clean a form field before the clean method?

2010-12-04 Thread Wayne Smith
Sure. Just override the clean method for the field, or the whole form if you wish. The built-in "default" validation done by Django doesn't handle any logic; it just makes sure the format and type of each field is appropriate. On Dec 4, 2010 1:44 PM, "refreegrata" wrote: > ok, thanks for the ans

UTF-8 support in custom tags

2010-12-04 Thread Maxim
Hi, I'm trying to write a custom tag that does a very simple action: sets the value into a variable. E.g. {% set variable %}The value{% endset %} Here's the essential part of the code (omitting some details): def set_tag(parser, token): nodelist = parser.parse(("endset",)) parser.delete_firs

Re: UTF-8 support in custom tags

2010-12-04 Thread Ramiro Morales
On Sat, Dec 4, 2010 at 3:38 PM, Maxim wrote: > Hi, > > I'm trying to write a custom tag that does a very simple action: sets > the value into a variable. E.g. > {% set variable %}The value{% endset %} > > Here's the essential part of the code (omitting some details): > > def set_tag(parser, token)

Re: Need a tip on how to architect this code to be more extensible

2010-12-04 Thread Sontek
I still haven't came up with a creative solution on this, is there anyone that might be able to give me some ideas? On Nov 29, 12:25 am, Sontek wrote: > I wrote this open source project that allows you to use the django > admin pop-ups in your own views but I want to give it the ability to > have

Re: UTF-8 support in custom tags

2010-12-04 Thread Maxim
Hi Ramiro, Thanks for tip. Setting DEFAULT_CHARSET = "UTF-8" FILE_CHARSET = "UTF-8" did the trick, though I thought it is UTF-8 by default and doesn't have to be set explicitly. Anyway now everything's working. Thanks! --- Maxim On Dec 5, 2:17 am, Ramiro Morales wrote: > On Sat, Dec 4, 2010