Re: Extension to QuerySet.values()

2013-10-09 Thread Russell Keith-Magee
Hi Arnaud, I can see value in the feature you're describing here. >From a design perspective, my question would be whether a whole new method is needed, or whether it could be integrated into the existing values() method. There will be some complications around the 'flat' key, but its worth

Re: Implementation of a Search Engine. How??

2013-10-09 Thread Kelvin Wong
Look up Solr because it does everything you want. You can crawl with Nutch. Django can be used as a front end to that. http://en.wikipedia.org/wiki/Apache_Solr K On Wednesday, October 9, 2013 11:57:25 AM UTC-7, Mithil Bhoras wrote: > > Hello, I am a newbie in Django. I am required to do a

Re: Retrieving json stored in TextField as json

2013-10-09 Thread Rafael Durán Castañeda
I'm using django-json-field [1] for solving the same problem. [1] https://github.com/derek-schaefer/django-json-field HTH El 09/10/2013, a las 16:01, Marc Aymerich escribió: > Hi, > I'm storing large volumes of json data in a TextFields, Then I have a > view that converts

Re: Implementation of a Search Engine. How??

2013-10-09 Thread Patrick Müssig
Hi, maybe is http://yacy.net/ what are you looking for. You can use Yacy as Searchengine and fetch over the yacy API the data. Yacy has also a good crawler to crawling webpages and indexing this pages. greetz Patrick Müssig 2013/10/9 Mithil Bhoras > Hello, I am a

Re: Nested includes and captured parameters

2013-10-09 Thread Jason Mayfield
Nevermind. Discovered typo in a URLconf regex that was causing the problem. On Wednesday, October 9, 2013 2:41:45 PM UTC-4, Jason Mayfield wrote: > > The docs state that "An included URLconf receives any captured parameters > from parent URLconfs". And that does work as expected, when the

Nested includes and captured parameters

2013-10-09 Thread Jason Mayfield
The docs state that "An included URLconf receives any captured parameters from parent URLconfs". And that does work as expected, when the child URLconf makes immediate use of the parameter -- that is, the child URLconf is a terminal node and doesn't include any further child URLconfs. In my

Implementation of a Search Engine. How??

2013-10-09 Thread Mithil Bhoras
Hello, I am a newbie in Django. I am required to do a project in Python and I've chosen Django as the Web Framework. My project is a 'Smart' Search Engine that retrieves results most relevant to user's query. This website will: 1. Index all the web pages available 2. Use Page Ranking

Re: admin.py: putting "if condition" in ModelAdmin according to username

2013-10-09 Thread Timothy W. Cook
In the ModelAdmin I use a get_form() to test for conditions on the object. Specifically, if this item has been published then make it read_only. You should be able to test for users as well. I had to add the try/except in order to add new objects because obj.published doesn't exist on a new

Re: Looking for a way to detect changes in database records with low storage footprint

2013-10-09 Thread Nikolas Stevenson-Molnar
A hash should work fine. Alternatively, you could diff the two records, using something like difflib: http://docs.python.org/2/library/difflib.html _Nik On 10/9/2013 8:05 AM, DJ-Tom wrote: > Hi, > > a customer has requested a function to "compare" reports. > > So let's say I create a database

Re: Table in models.py not being created during syncdb

2013-10-09 Thread Edward Lazarenko
Can you tell what did you exactly do, to make it work? On Wednesday, March 31, 2010 10:16:11 PM UTC+5, wchildsuk wrote: > > Hi, > > I'm using the django app, django-schedule (http://github.com/thauber/ > django-schedule) and am adding an additional table to map users to > calendars (see line 253

Looking for a way to detect changes in database records with low storage footprint

2013-10-09 Thread DJ-Tom
Hi, a customer has requested a function to "compare" reports. So let's say I create a database report on Monday, then the data is constantly changing the whole week and on the following Monday it should be possible to get a report that either contains only changed and new records or all

Re: Ho can I reverse urls inside urls.py?

2013-10-09 Thread DJ-Tom
Hi Tom, works like a charm - THX! Cheers Thomas Am Dienstag, 8. Oktober 2013 17:49:18 UTC+2 schrieb Tom Evans: > > > Use reverse_lazy > > https://docs.djangoproject.com/en/1.5/ref/urlresolvers/#reverse-lazy > > > Cheers > > Tom > -- You received this message because you are subscribed to

Re: admin.py: putting "if condition" in ModelAdmin according to username

2013-10-09 Thread Bill Freeman
It's easy, if you don't insist on making it part of the admin, to do this with a custom view. It can pay attention to whatever permissions you like. On Wed, Oct 9, 2013 at 10:06 AM, Victor wrote: > Yes, I know but unfortunately if in Admin Site you say that a user cannot >

Re: ModelMultipleChoiceField ignore invalid choices?

2013-10-09 Thread David Cox
This could be handled in the form clean() and/or save() methods using a try/catch block and passing on thrown exceptions. You'd have to figure out what would be an acceptable way to handle a form submission with an invalid selection, though. On Monday, October 7, 2013 11:15:43 AM UTC-5, Jon

Re: admin.py: putting "if condition" in ModelAdmin according to username

2013-10-09 Thread Victor
Yes, I know but unfortunately if in Admin Site you say that a user cannot Add, Delete, and Modify a model if that user is connected he/she doesn't see the model itself in the list but only those models for which it has some kind of permission. I instead would like to make the model visible but

Retrieving json stored in TextField as json

2013-10-09 Thread Marc Aymerich
Hi, I'm storing large volumes of json data in a TextFields, Then I have a view that converts this text data into JSON, but this silly operation requires a considerable amount of resources for a large dataset. It would be nice if I'm able to retrieve native JSON directly from the database. As you

Re: django model(s) silently fails to sync to the DB ( for no apparent reason )

2013-10-09 Thread David Cox
I just rtfc, and it might have been a copy-paste mistake, but the 'str_value' field in your 'DirEnumVal' class has unmatched quotation marks for the default attribute. On Monday, October 7, 2013 8:40:33 PM UTC-5, Doug S wrote: > > I don't think I'm making a rookie mistake, I've looked over my

Re: django model(s) silently fails to sync to the DB ( for no apparent reason )

2013-10-09 Thread David Cox
There's a chance that running 'manage.py sqlall' might show errors that syncdb can't display before failing. 'manage.py sqlall' validates the SQL without trying to commit it, so to save time in the future, you should really run it before syncdb every time. If not, and the app is installed,

Re: admin.py: putting "if condition" in ModelAdmin according to username

2013-10-09 Thread Rafael E. Ferrero
In Admin Site, you can manage users permissions for Add, Delete, Modify of every model on your site. 2013/10/9 Vittorio > For the sake of simplicity let's suppose I have > > models.py > > class Book(models.Model): > title = models.CharField(max_length=100) >

Re: Recommended dev environment for a Django project deployed to Linode

2013-10-09 Thread Jorge Arevalo
Interesting! I'm downloading it. Many thanks! On Thursday, September 26, 2013 7:54:55 PM UTC+2, Ezequiel wrote: > > On Wednesday, September 25, 2013 3:06:55 PM UTC-3, Jorge Arevalo wrote: > >> Fine. I don't think my boss is going to pay for PyCharm license, so I'll >> probably go for Eclipse now

Re: Recommended dev environment for a Django project deployed to Linode

2013-10-09 Thread Jorge Arevalo
Yep. VirtualEnvWrapper looks like a winner. And thanks for the suggestion about the requirements.txt On Thursday, September 26, 2013 1:36:21 PM UTC+2, Dump wrote: > > I have the same stack, GeoDjango + PostGIS (and all its dependencies like > GDAL, Proj, GEOS, etc). My notebook runs Debian

Re: Recommended dev environment for a Django project deployed to Linode

2013-10-09 Thread Jorge Arevalo
Tested. Works great. Thanks a lot! On Thursday, September 26, 2013 1:13:58 AM UTC+2, Cal Leeming [Simplicity Media Ltd] wrote: > > +1 for virtualenvwrapper, don't know how I survived without this!! > > Cal > > > On Wed, Sep 25, 2013 at 9:59 PM, Roberto López López > > wrote:

Re: Recommended dev environment for a Django project deployed to Linode

2013-10-09 Thread Jorge Arevalo
Thanks both for the suggestions! (and sorry for the delay, I was on a business trip). Looks like there's a lot of things to learn. I'll probably use a staging machine, like suggested. And now I'm between Eclipse, emacs and PyCharm. Time to work! On Wednesday, September 25, 2013 9:48:26 PM

admin.py: putting "if condition" in ModelAdmin according to username

2013-10-09 Thread Vittorio
For the sake of simplicity let's suppose I have models.py class Book(models.Model): title = models.CharField(max_length=100) authors = models.ManyToManyField(Author) publisher = models.ForeignKey(Publisher) Under admin I would like that some username (say "vic" and "lucky") can

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
Your right... I can't testing now. 2013/10/9 Hélio Miranda > gives error: > 'BaseList' object has no attribute 'values' > > The query has to be the same as I stated it works: > * >

Re: Query parameters for receiving post

2013-10-09 Thread Hélio Miranda
gives error: 'BaseList' object has no attribute 'values' The query has to be the same as I stated it works: * Player.objects.filter(country__in=Country.objects.filter(nationality__in=Nationality.objects.filter(name='Espanhola'))) * -- You received this message because you are subscribed to the

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
try this solution http://plnkr.co/edit/cyM6AmZcyFVUU6soFKhB 2013/10/9 Denis Chernoshchekov > ok, i understand, i minute. > > > 2013/10/9 Denis Chernoshchekov > >> *fld_name = 'nationality_in' *must be with double '_'* **fld_name = >>

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
ok, i understand, i minute. 2013/10/9 Denis Chernoshchekov > *fld_name = 'nationality_in' *must be with double '_'* **fld_name = > 'nationality__in'* > > > 2013/10/9 Denis Chernoshchekov > >> Sorry, i don't understand you... You can

Extension to QuerySet.values()

2013-10-09 Thread Arnaud Delobelle
Hi there, I quite often find that when using queryset.values() I would like to be able to define myself the values of the keys, especially when they span models: e.g. my_query_set.values('foo__bar__baz', 'quux', 'another__long__field__name') Then I end up with dictionaries with

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
*fld_name = 'nationality_in' *must be with double '_'* **fld_name = 'nationality__in'* 2013/10/9 Denis Chernoshchekov > Sorry, i don't understand you... You can control all your values for all > fields, you can generate dict which you like. > > > 2013/10/9 Hélio

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
Sorry, i don't understand you... You can control all your values for all fields, you can generate dict which you like. 2013/10/9 Hélio Miranda > I put that work, I wanted to know was how to put in the code, because you > can not do the same to position > > -- > You received

Re: Query parameters for receiving post

2013-10-09 Thread Hélio Miranda
was trying something like this: *if fld_name == 'nationality':* *fld_name = 'nationality_in'* *value = Player.objects.filter(country__in=Country.objects.filter(nationality__in=Nationality.objects.filter(name=value))) * But it does not work -- You

Re: Query parameters for receiving post

2013-10-09 Thread Hélio Miranda
I put that work, I wanted to know was how to put in the code, because you can not do the same to position -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
Try this - *Player.objects.filter(country__in=** Nationality.objects.filter(name='Espanhola').distinct('country').values('country')) * 2013/10/9 Hélio Miranda > yes, that was it ... > Just one more thing, if I would like to create the nationality of the > player, so that

Re: Query parameters for receiving post

2013-10-09 Thread Hélio Miranda
yes, that was it ... Just one more thing, if I would like to create the nationality of the player, so that the filter is: * Player.objects.filter(country__in=Country.objects.filter(nationality__in=Nationality.objects.filter(name='Espanhola'))) * * * where only the step nationality, as I do, not

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
See, maybe like this? http://plnkr.co/edit/cyM6AmZcyFVUU6soFKhB 2013/10/9 Hélio Miranda > I have code like this: > http://plnkr.co/edit/L1ByIyFyaEdgwrfVU7Jr > > Just do not know how to put this part in the code ... > Where do I put this part? > > -- > You received this

Re: Query parameters for receiving post

2013-10-09 Thread Hélio Miranda
I have code like this: http://plnkr.co/edit/L1ByIyFyaEdgwrfVU7Jr Just do not know how to put this part in the code ... Where do I put this part? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
For position you may have dict like - **{' position__in ': Position.objects. filter(name=positionpost) } 9 жовт. 2013 11:45, користувач "Hélio Miranda" написав: > hi, thanks that helped a lot. > But I have a problem which is, for example when I do a filter by position, > is

Re: Query parameters for receiving post

2013-10-09 Thread Hélio Miranda
hi, thanks that helped a lot. But I have a problem which is, for example when I do a filter by position, is not direct as other fields like name or surname. For the position I have to type this: * Player.objects.filter(position__in=Position.objects.filter(name=positionpost)) * How can I

Re: Query parameters for receiving post

2013-10-09 Thread Denis Chernoshchekov
You can pass filter params like a dict - Player.objects.filter(**your_dict), so you need only prepare your dict from POST. 8 жовт. 2013 17:42, користувач "Hélio Miranda" написав: > Hi > Here I am having a problem which is as follows: > I 'm getting parameters via post to make

Re: What is the right location for my django translation files?

2013-10-09 Thread Diederik van der Boor
You can place a new .po file in a `locale` folder of one of your INSTALLED_APPS. This will be picked up, and can override the locale of mezzanine, if your app is placed before mezzanine in INSTALLED_APPS. Off course, run django-admin.py compilemessages in the root folder where the `locale`

Re: Query parameters for receiving post

2013-10-09 Thread Hélio Miranda
I was testing you sent me, but it is giving me error ... is giving this error: *expected string or buffer* -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: What is the right location for my django translation files?

2013-10-09 Thread Anton Melser
> > I'm giving my first steps with python/django/mezzanine so please bear with > me. > > I modified a translation file of the mezzanine's blog application and > compiled it OK. Mind you: I literally only modified a couple of words and > left the rest intact. > > The only place I found out I

Re: __unicode__() addition not working in basic poll application.

2013-10-09 Thread Nigel Legg
show us your code, and someone might show you where it is wrong, but the tutorial is pretty clear on what you have to do. Cheers, Nigel 07914 740972 On 8 October 2013 22:42, Brachamul wrote: > Could someone post what the entire "models.py" file should look like at >