Re: Django E-Commerce Framework

2011-12-06 Thread kenneth gonsalves
On Tue, 2011-12-06 at 08:11 -0500, Daniel Cure V. wrote: > You can try with Satchmo.Its a very robust framework. is it ecommerce? -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: filtering on a model method

2011-12-06 Thread kenneth gonsalves
On Tue, 2011-12-06 at 13:04 +, Tom Evans wrote: > > say I have a model method like get_age(self), can I filter on this? > > > > Mymodel.objects.filter(get_age() = 5) (this does not work, but any > ideas > > would be appreciated) > > You can't do this. Querysets are interfaces to the database,

Re: Internationalization and localization

2011-12-06 Thread kenneth gonsalves
On Mon, 2011-12-05 at 19:00 -0800, rentgeeen wrote: > What I want to how to translate stuff from DB, all at django official > say is about static content, what I have only found is this: > > django-modeltranslation -- regards Kenneth Gonsalves -- You received this message because you are subs

Re: Updating parent record, when child record changes

2011-12-06 Thread Mike Dewhirst
On 6/12/2011 8:40pm, zobbo wrote: I asked a similar question last week but got no responses - here's a related but hopefully simpler question. What is the recommended way to update a field on a parent record when one or more of it's child records (held in inlines) are modified? I could hook on p

Re: Internationalization and localization

2011-12-06 Thread rentgeeen
I am using EASYMODE And that created in my DB 3 INFO textfields for each language, and when is 1 language selected it will show particular text corresponding to selected language. But what I want to achieve is if I give somebody link: it/sample/ en/sample/ it will show that page in that langua

Re: Internationalization and localization

2011-12-06 Thread Lachlan Musicman
There's no official support for translation of what you have in your DB - but that's because it's not a core need of most projects, coupled with the fact that there are a number of ways to do it, none of which are more correct than the other. For example - do you have a mirror db per language, or i

Re: Query with no-correspondence results

2011-12-06 Thread Reinout van Rees
On 06-12-11 22:48, Ian Clelland wrote: Raw SQL: select thing, name, vote from mydatabase_votecontext left join mydatabase_vote on (mydatabase_vote.context_id = mydatabase_votecontext.id ) where thing='Carrot' and user='Me' That should return null if there is no

Re: Management commands inside namespaced packages not found

2011-12-06 Thread cberner
I see. The namespaced packages weren't a problem until I tried to install them with egg-links, so it seems like this is more of a deficiency in setuptools. I'll look around for a solution On Dec 6, 4:54 am, Reinout van Rees wrote: > On 06-12-11 06:34, cberner wrote: > > > > > > > > > > > I've run

Re: Query with no-correspondence results

2011-12-06 Thread Ian Clelland
On Tue, Dec 6, 2011 at 1:35 PM, Reinout van Rees wrote: > Ah! Now I get your point. You also want the "empty" results for which > there's no SQL data. Sorry, but I don't see a way in which you can do that > with an SQL query (and so also not with a Django query). > > In case you want all contexts,

Re: Django E-Commerce Framework

2011-12-06 Thread Stuart Laughlin
I have firsthand experience implementing satchmo for a very large storefront, and I can heartily recommend it. People who recommend writing your own ecommerce platform have an overly romanticized perspective. In my opinion ecommerce is not where you want to make your own mistakes and go by trial an

custom attributes of model field

2011-12-06 Thread trubliphone
Hello, Is there a way in Django to add custom attributes to a model fields (without resorting to subclassing fields)? I would like to only display certain fields in certain sections of my template. (Eventually, each type of field will be displayed in a separate tab.) I thought about adding

Re: Query with no-correspondence results

2011-12-06 Thread Reinout van Rees
On 06-12-11 21:11, wgis wrote: I get (Carrots, Flavor,2.0) I want to list all the contexts in the "Carrot template", withou having to search and merge the ones missing. So if the result was (Carrots, Flavour, 2.0) (Carrots, Smell, 0.0) (Carrots, Usability, 0.0) (Carrots, Size, 0.0) or (Carrots,

Re: Query with no-correspondence results

2011-12-06 Thread Andre Terra
I'll admit that I read through the thread in about a minute, so forgive me if I'm completely off, but isn't this something that can be solved through aggregation[1]? And you don't want votes, but rather *contexts*, because all of these matter to you, whereas votes can be 0 (default). Speaking of w

Re: Query with no-correspondence results

2011-12-06 Thread wgis
I get (Carrots, Flavor,2.0) I want to list all the contexts in the "Carrot template", withou having to search and merge the ones missing. So if the result was (Carrots, Flavour, 2.0) (Carrots, Smell, 0.0) (Carrots, Usability, 0.0) (Carrots, Size, 0.0) or (Carrots, Flavour, 2.0) (Carrots, Smell, n

Re: Django E-Commerce Framework

2011-12-06 Thread Denhua
Hi Pete, Do you mean django-authorizenet? I can't find a django-authorize. Thanks, Dennis On Dec 6, 9:04 am, CrabbyPete wrote: > Roll your own and use packages like django-authorize and django-paypal > they are easy to use and don't bring along lots of baggage. > > On Dec 6, 8:19 am, Andre Terr

Re: many-to-many queryset question

2011-12-06 Thread Felipe Morales
could you possibly show the query generated?... # print qs.query 2011/12/6 Carsten Fuchs > Hi all, > > looking at the example models Author and Entry at > https://docs.djangoproject.**com/en/1.3/topics/db/queries/, > I would like to run

many-to-many queryset question

2011-12-06 Thread Carsten Fuchs
Hi all, looking at the example models Author and Entry at https://docs.djangoproject.com/en/1.3/topics/db/queries/, I would like to run a query like this: SetOfAuthors = Authors.objects.filter(...) qs = Entry.objects.filter(authors__in=SetOfAuthors) such that (pseudo-code):

Is there a model to allow Django to insert or append records in the TabularInline style to the main table?

2011-12-06 Thread vfclists
Following the style of the Django tutorial I want to add records in the TabularInline style on the main table, not in the master/detail style used in the tutorial. The ideal approach would be to have a list_display and specify how many empty rows should be inserted or appended to the list when you

Re: help optimizing a snippet

2011-12-06 Thread Tom Evans
On Tue, Dec 6, 2011 at 2:24 PM, Felipe Morales wrote: > Hi, > > Maybe I can't understand you, but try with > > u = User.objects.filter(groups__name__in = > gruppe).exclude(groups__name__in='Timesheet-Boss','TimeSheet-Manager','Projektleiter','Normal-User','Manager']).values_list('id', > 'username'

AW: help optimizing a snippet

2011-12-06 Thread Szabo, Patrick (LNG-VIE)
Amazing12 queries left and that's hell of a lot faster J Thank you guys ! Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Felipe Morales Gesendet: Dienstag, 06. Dezember 2011 15:24 An: django-users@googlegroups.com Betreff: Re: help optimizing a

Re: Template filter with multiple non-string arguments?

2011-12-06 Thread Nan
This is actually one case where that probably won't work -- some_other_var is a dict that needs a specific key set to object.field's value on each run through the loop, and it seems ridiculous to make a copy of it for each object in object_list. I think the only solution is going to be a big fanc

Re: help optimizing a snippet

2011-12-06 Thread Felipe Morales
Hi, Maybe I can't understand you, but try with u = User.objects.filter(groups__name__in = gruppe).exclude(groups__name__in= *'Timesheet-Boss'*,*'TimeSheet-Manager'*,*'Projektleiter'*,*'Normal-User'*,* 'Manager'*]).values_list('id', 'username') 2011/12/6 Szabo, Patrick (LNG-VIE) > Hi, > >

Re: help optimizing a snippet

2011-12-06 Thread Tom Evans
On Tue, Dec 6, 2011 at 1:42 PM, Szabo, Patrick (LNG-VIE) wrote: > Hi, > > > > I’v got this piece of code: > > > > def get_my_choices(gruppe): > >     users = User.objects.all() > >     choices_list = () > >     for user in users: > >     try: > >     for groupe in gruppe: > >  

Re: How to deploy new code to the Production Server?

2011-12-06 Thread Kevin Daum
I use pip and virtualenv for reproducible environments, nginx and gunicorn as production web servers, init.d scripts (on debian) for managing gunicorn (and just about everything other important process on the server), mercurial for source control and fabric for deployment. I keep all files necessar

Re: One from from multiple models using ModelForm

2011-12-06 Thread CrabbyPete
That is to bad. I have a project that I use mongodb and mongotools and I can do the following with one form and it works great. I wonder if any other form tools can do it class UserForm ( MongoForm ): class Meta: document = User fields = ('first_name','last_name') class Profi

Re: Django E-Commerce Framework

2011-12-06 Thread CrabbyPete
Roll your own and use packages like django-authorize and django-paypal they are easy to use and don't bring along lots of baggage. On Dec 6, 8:19 am, Andre Terra wrote: > I haven't worked with either one of them, but satchmo[1] is also often > mentioned. > > Django packages also has a list of e-c

Re: AW: Performance

2011-12-06 Thread Felipe Morales
Sorry, I was wrong, the sintax is: queryset = Model.objects.filter().select_related('field', 'field2') 2011/12/6 Felipe Morales > No, when you use the select_related method, the query that generated is: > > SELECT * FROM tablename > INNER JOIN tablename2 ON (tablename.field = tablename2.fi

help optimizing a snippet

2011-12-06 Thread Szabo, Patrick (LNG-VIE)
Hi, I'v got this piece of code: def get_my_choices(gruppe): users = User.objects.all() choices_list = () for user in users: try: for groupe in gruppe: for groupe2 in user.groups.all(): if groupe2 == groupe and (user

Re: Conditional choice fields for model specification...

2011-12-06 Thread Derek
On Dec 5, 11:06 pm, Marc Edwards wrote: > I would like to create my choice fields in my models according to a > hierarchy of conditions, but I can't think of how to specify this in > Python. Marc You'd need to do this using Javascript/AJAX, in the browser. Your model definition would contain al

Re: Internationalization and localization

2011-12-06 Thread Andres Reyes
At the moment i don't know of any official support for that kind of internationalization from Django, there are a number of different Packages that try to address the problem with some level of success. In one project of mine i used the approach described in http://snippets.dzone.com/posts/show/297

Re: AW: Performance

2011-12-06 Thread Felipe Morales
No, when you use the select_related method, the query that generated is: SELECT * FROM tablename INNER JOIN tablename2 ON (tablename.field = tablename2.field) WHERE The problem is when you have a null value in a field that is foreing key. You'll can try to fix this or yo

Re: slow function

2011-12-06 Thread Håkon Erichsen
2011/12/6 kenneth gonsalves > > I first did select_related() and the laptop nearly caught fire! timed > out after an hour or so. I then did select_related(depth=1) and it took > less than a minute. > Indeed, select_related() will follow every foreignkey it gets to, which can be a lot, so you eit

Re: Django E-Commerce Framework

2011-12-06 Thread Andre Terra
I haven't worked with either one of them, but satchmo[1] is also often mentioned. Django packages also has a list of e-commerce tools for django [2]. Hope that helps! Cheers, AT [1] http://www.satchmoproject.com/ [2] http://djangopackages.com/grids/g/ecommerce/ On Tue, Dec 6, 2011 at 10:55

Re: Django E-Commerce Framework

2011-12-06 Thread Daniel Cure V.
Hello people. You can try with Satchmo .Its a very robust framework. Daniel Cure Velasquez -- 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

Re: filtering on a model method

2011-12-06 Thread Tom Evans
On Tue, Dec 6, 2011 at 7:09 AM, kenneth gonsalves wrote: > hi, > > say I have a model method like get_age(self), can I filter on this? > > Mymodel.objects.filter(get_age() = 5) (this does not work, but any ideas > would be appreciated) You can't do this. Querysets are interfaces to the database,

Re: Django E-Commerce Framework

2011-12-06 Thread Reinout van Rees
On 06-12-11 06:40, Md,Mehedi Hasan Kabir(Tanim) wrote: Can anyone give me some suggestion/link for Django E-Commerce Framework? No personal experience, but the one I see mentioned most often: django lightning fast shop. http://www.getlfs.com/ Reinout -- Reinout van Rees

Re: Management commands inside namespaced packages not found

2011-12-06 Thread Reinout van Rees
On 06-12-11 06:34, cberner wrote: I've run into an issue with namespaced packages that are installed in development mode. I have two packages that are installed with pip in development mode (pip install develop): A.B.management.commands (code in ~/A.B/A/B/management/commands/) and A.C.management

Re: Template filter with multiple non-string arguments?

2011-12-06 Thread Reinout van Rees
On 06-12-11 02:05, Nan wrote: So, yes, I know one can combine template filter arguments by quoting them into a single concatenated string... But what if one needs to do something that amounts to the following? {% for object in object_list %} {{ some_other_var|custom_filter(constant_string,

Re: Query with no-correspondence results

2011-12-06 Thread Reinout van Rees
On 06-12-11 06:43, wgis wrote: But then I would have something like (Carrots, Flavor,2.0) as the result instead of the desired (Carrots, Flavour, 2.0) (Carrots, Smell, 0.0) (Carrots, Usability, 0.0) (Carrots, Size, 0.0) That's the same, right? At least, Vote.objects.filter(thing=carrot).valu

Re: New design for class-based views

2011-12-06 Thread Tobia Conforto
On Dec 5, 6:37 pm, Reinout van Rees wrote:> That link will expire in a month, so that's not really suited to posting> on a mailinglist that people might still read a month from now. You're right. Here is another link: http://pastebin.com/w7u74AJ7 On Dec 5, 4:07 pm, sebastien piquemal wrote: > Cou

filtering on a model method

2011-12-06 Thread kenneth gonsalves
hi, say I have a model method like get_age(self), can I filter on this? Mymodel.objects.filter(get_age() = 5) (this does not work, but any ideas would be appreciated) -- regards Kenneth Gonsalves -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Goog

Django E-Commerce Framework

2011-12-06 Thread Md,Mehedi Hasan Kabir(Tanim)
Hi Can anyone give me some suggestion/link for Django E-Commerce Framework? Regards Tanim -- 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, send

Management commands inside namespaced packages not found

2011-12-06 Thread cberner
I've run into an issue with namespaced packages that are installed in development mode. I have two packages that are installed with pip in development mode (pip install develop): A.B.management.commands (code in ~/A.B/A/B/management/commands/) and A.C.management.commands (~/A.C/A/C/management/comm

Internationalization and localization

2011-12-06 Thread rentgeeen
I have a question about internationalization - https://docs.djangoproject.com/en/dev/topics/i18n/internationalization/ What I want to how to translate stuff from DB, all at django official say is about static content, what I have only found is this: http://packages.python.org/django-easymode/i18n

Re: slow function

2011-12-06 Thread kenneth gonsalves
On Mon, 2011-12-05 at 11:18 +0100, Håkon Erichsen wrote: > One thing you should look into is > QuerySet.select_related(): > https://docs.djangoproject.com/en/dev/ref/models/querysets/#select-related > > Without it, every time you run scr.hole on a new scr, Django will run > a new query, fetching

Re: New design for class-based views

2011-12-06 Thread Tobia Conforto
On Dec 5, 12:56 am, Russell Keith-Magee wrote: > On Sun, Dec 4, 2011 at 12:43 PM, akaariai wrote: > > I don't know much about class based views, but I do know that their > > design thread at django-developers was _very_ long. So, there might be > > reason why things are done as they are. > > Inde

Re: slow function

2011-12-06 Thread kenneth gonsalves
On Tue, 2011-12-06 at 02:15 -0800, Derek wrote: > Another side comment would be a suggestion to avoid "old skl vrbl nms" > - in other words, use "player" for "ply", "month" for "mnth", "scores" > for "scrs", "form" for "fm" and so on. It may seem obvious right now > what those mean, but you (or so

Re: slow function

2011-12-06 Thread Derek
On Dec 5, 12:18 pm, Håkon Erichsen wrote: > 2011/12/5 kenneth gonsalves > > > That seems to be the biggest problem you have. Some other comments: > > - Holy mother of god, that's a huge view file! I would advice to slice > it into logically separated files, and put this in a directory called > "v

Updating parent record, when child record changes

2011-12-06 Thread zobbo
I asked a similar question last week but got no responses - here's a related but hopefully simpler question. What is the recommended way to update a field on a parent record when one or more of it's child records (held in inlines) are modified? I could hook on post_save on the inlines, but if you