Re: populating forms using models
To populate select field you have many options. First is using ModelChoiceField. The ModelChoiceField have an argument named queryset, you can use like this example provincia = forms.ModelChoiceField(queryset=Provincia.objects.all() ..) If you can't have a FK of Provincia table you can use a Choice Field and populate externaly like this provincia = forms.ChoiceField( ... ) and inside the form declare a new method named populate(self, list_of_provincias): (for example) and inside this method you can do this... self.fields['provincia'].choices = list_of_provincias In other situations you can populate a ModelcoiceField externaly too: example: You need to populate a modelchoice field with a queryset depending in the user loged ... def populate(self,user): self.fields['boards'].queryset = Board.objects.filter( guild = Guild.objects.get(owner=user) ) When you create a form yo need to call the .populate method with request.user as argument. 2008/11/1 Rock <[EMAIL PROTECTED]> > > In brief, your forms field for province does not have to have anything > to do with your corresponding model field. > Just make a forms.ChoiceField with the data filled in that you need > (or else look up the pattern for loading dynamic data into a > forms.ChoiceField and do something like that.) If you go the dynamic > route, make sure your form gets initialized properly when you create > it for initial use and also when you create it for POST processing. > > > > > -- neo2001[at]gmail.com neo[at]art-xtreme.com --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Django Model key limits
Hello !I'm working in a project using django an postgresql and probably i will manage a big model table. I have a few questions about the limits of the primary key in django model. By default the pk was defined in postgresql as a SERIAL NOT NULL with the integer data type. I search for the limits of this type and this postgresql page [1] puts the limit at (range -2147483648 to +2147483647). This is a big table, but first estimations make this number not really big. As I can read in the same page, if we use a bigint the limit will be (-9223372036854775808 to 9223372036854775807) , this is a really big number :D So... i change the type of the id column in my database to bigint and i insert a new row with the id 277147483647 ( big for int , good por bigint). I start testing the admin of my model and... it works great with this numbers. What consequences will have this change in the future ? This will work ? Django is ready to this pk numbers? Thanks a lot PD : Sorry about my bad english [1] http://www.postgresql.org/docs/7.4/interactive/sql-createsequence.html -- neo2001[at]gmail.com neo[at]art-xtreme.com --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: two forms in the same view
Or use prefix theform(request.POST,prefix='form1Prefix') theform2(request.POST,prefix='form2Prefix') 2008/12/18 Stefan Tunsch > > You simply have to avoid using the same field name in the two forms. > > On 12/18/08, Alfredo Alessandrini wrote: > > > > Hi, > > > > can I use two form in the same view function? > > > > if request.method == 'POST': > > form = FORM_1(request.POST) > > if form.is_valid(): > >. > > form = FORM_2(request.POST) > > if form.is_valid(): > >. > > > > It's possible? > > > > Thanks in advance, > > > > Alfredo > > > > > > > > > > > -- neo2001[at]gmail.com neo[at]art-xtreme.com --~--~-~--~~~---~--~~ 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 email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django questions
You are in thre wrong list. This is the django-users list , no the django-no-users list. 2008/9/10 Krommenaas <[EMAIL PROTECTED]> > > Thx for the replies. > > This is still unclear though: > > > 4) I read somewhere in the documentation that you can use other > > > templating systems than Django's own. Is it also possible to just use > > > Python inside the views? > > > > If you use an appropriate templating language that supports that, yes. > > I don't want to use a templating language, I'd want to use Python > itself inside the views. Possible or not? > > Tia, > > > > -- neo2001[at]gmail.com neo[at]art-xtreme.com neo[at]nosoypirata.com --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Ajax in Django
I' currently working in/with Dajax. http://code.google.com/p/dajaxproject/ I hope it helps you. -- neo2001[at]gmail.com jorge[at]thecodefarm.com neo[at]art-xtreme.com --~--~-~--~~~---~--~~ 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 email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: GeoDjango, Convert List of Polygon Objects to a Single Polygon Object
You can use topological methods ( http://geodjango.org/docs/geos.html#topological-methods ) polygon.union( other_polygon ) Hope it's help you. 2009/8/20 GRoby > > Hello, > > How can I convert a list of Polygon objects into a Single Polygon > Object utilizing GeoDjango? I think I need to use the buffer feature, > but am not sure how to. Is there a way to use a buffer feature or do > I need to code this out in Python. > > Gregory Roby > > > > > > > > -- neo2001[at]gmail.com jorge[at]thecodefarm.com neo[at]art-xtreme.com --~--~-~--~~~---~--~~ 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 email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ManyToMany relationship being 'lost'?
Hello Rubens,I have similar problems months ago. In my application there is a ManyToMany relation within two classes (A and B) let's name the relation as "friends". The application works fine but in unpredictable situations rows from the auxiliary table that makes the relation disappears randomly. I read all the code, an check the "strange" situations one by one. Finally the problem was that, I use auto generated ModelForms, and in the exclude rows i didn't include the "friend" field. As you, the relation has the parameters (blank=True, null=True). The relation disappears when (existing a relation) y use this modelForm without including any info for the friends field (I don't what to edit this information at this point). At this moment, django erases the relation within A an B because wasn't explicit declared and the forms validates because it can be blank and null. The solution? Include "friend" in the exclude list of the model Form. You are using the default Admin, i was using own forms / templates, but i suppose internally, django generate forms with modelForms-like classes. Hope this help you. -- neo2001[at]gmail.com jorge[at]thecodefarm.com neo[at]art-xtreme.com --~--~-~--~~~---~--~~ 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 email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Form trouble
2009/5/17 zayatzz > > Thanks > > I actually tried that form.cleaned_data at one point but then i got > error that was something like: form object has no cleaned_data > attribute. Call if form.isvalid(): # use cleaned_data Jorge > > > Anyway, its working now - thanks alot. > > btw... what is tuple? i am not native english speaker so i fail to > understand some words like that. It's a python data structure. It's an "" Array "" . > > > Alan > > On May 17, 2:02 am, Daniel Roseman > wrote: > > On May 16, 10:51 pm, Alex Gaynor wrote: > > > > > > > > > On Sat, May 16, 2009 at 4:49 PM, zayatzz > wrote: > > > > > > Hello > > > > > > Been trying to figure out where the problem is, but its almost 1am > and > > > > im out of ideas. > > > > > > i have this model: > > > > class tuser (models.Model): > > > >username = models.CharField(max_length=20, help_text="Enter > Username > > > > of your account") > > > >email = models.EmailField(max_length=100, help_text="Enter > your e- > > > > mail address", unique=True) > > > >pwd = models.CharField(max_length=100, help_text="Enter your > > > > password") > > > >active = models.SmallIntegerField(help_text="Different states > of > > > > activity - inactive, active...") > > > >joined = models.DateField(help_text="Date when registered") > > > >llogin = models.DateField(help_text="Date of last activity", > > > > null=True) > > > > > > then i have this form: > > > > class RegisterForm(ModelForm): > > > >class Meta: > > > >model = tuser > > > >fields = ('email') > > > > > > this is the view that handles the post: > > > > def regattempt(request): > > > >if request.method == 'POST': > > > >form = RegisterForm(request.POST) > > > >if form.is_valid(): > > > >p = tuser(username=form.email, > email=form.email, > > > > pwd=randompass > > > > (12), active = 1, joined = datetime.datetime.now()) > > > >p.save() > > > >else: > > > >form = RegisterForm() > > > >return render_to_response('authprof/register.html', { > > > >'form': form, > > > >}) > > > > > > i've been trying to follow different examples like : > > > > > > > http://docs.djangoproject.com/en/1.0/topics/forms/#processing-the-dat... > > > > > > The error i get is : > > > > 'RegisterForm' object has no attribute 'email' > > > > > > Request Method: POST > > > > Request URL:http://127.0.0.1/account/register/regattempt/ > > > > Exception Type: AttributeError > > > > Exception Value: > > > > > > 'RegisterForm' object has no attribute 'email' > > > > > > Exception Location: /home/projects/tst/authprof/views.py in > > > > regattempt, line 47 > > > > > > line 47 is the p = tuser(so-on and so-forth > > > > > > If anyone can explain me where this error comes from i would be very > > > > happy. > > > > > > Alan > > > > > The issue is ('email') is a string, and you need a tuple there, so it > > > should have a comma: ('email',) > > > > > Alex > > > > Well, that's one issue. The other is that you can't refer to form > > fields as attributes on the form instance. In fact, on the very link > > that the OP gave, it shows the right way to do it: > > p = tuser(username=form.cleaned_data['email'] > > etc ... ) > > -- > > DR. > > > -- neo2001[at]gmail.com jorge[at]thecodefarm.com neo[at]art-xtreme.com --~--~-~--~~~---~--~~ 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 email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Form trouble
> > > Call > if form.*is_valid()*: Sorry > > # use cleaned_data > > Jorge > > >> >> -- neo2001[at]gmail.com jorge[at]thecodefarm.com neo[at]art-xtreme.com --~--~-~--~~~---~--~~ 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 email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django with ajax
Hello Marc, You can render a template into an string. from django.template.loader import render_to_string my_template = render_to_string('template.html',{'some':'data'}) If you want to send the list of objects to the browser you can use serialization into json: http://docs.djangoproject.com/en/dev/topics/serialization/#id2 In other hand, i'm currently developing Dajax ( http://code.google.com/p/dajaxproject/) it will help you using ajax in django. For example, for sending serialized objects to the browser and use it as you want in JS. Thanks 2009/6/2 Aldo > > Hey, > > I have some ajax running on my pages. > > I want to have it pass back some objects. However, I am unsure if I > can pass a list of objects back. So far I have only ever passed back > raw xml or text. Can objects be passed and then iterated via the html > template? > > Thanks > > > -- neo2001[at]gmail.com jorge[at]thecodefarm.com neo[at]art-xtreme.com --~--~-~--~~~---~--~~ 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 email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: using ajax with django
> > > To use ajax you need to be able to make AJAX connections through > javascript and make your view.py code to return the right format > depending on the request (html, xml, json). So theres nothing special > you need to install. > As Anton says, you didn't need any special library to use ajax in django, but if you need an "easy-way" try http://dajaxproject.com/ it may help you. Greetings -- jorge[at]thecodefarm.com neo2001[at]gmail.com neo[at]art-xtreme.com --~--~-~--~~~---~--~~ 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 email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Prevent brute-force password attacks?
Check http://code.google.com/p/django-axes/ Bye ! 2009/11/9 Adam Seering > > Hi, >Does there exist any code for Django to help defeat brute-force > login > attempts? Something like blocking IP addresses from logging in if they > try and fail too many times, etc. > > Adam > > > > > -- Benito Jorge Bastida jo...@thecodefarm.com thecodefarm SL Av. Gasteiz 21, 1º Derecha 01008 Vitoria-Gasteiz http://thecodefarm.com Tel: (+34) 945 06 55 09 --~--~-~--~~~---~--~~ 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 email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Google maps routes in geodjango
Probably you can download the route as KML. Parse that XML, and use the data in your app Hope this help you Best Regards 2010/1/25, Alexis Selves : > Hi there, > I am new here by the way. > I have only simple question, how can I extract route from google map > and save it into geodb as multipoint or etc.. > Thanks for answers. > > -- > 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 unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Benito Jorge Bastida jo...@thecodefarm.com thecodefarm SL Av. Gasteiz 21, 1º Derecha 01008 Vitoria-Gasteiz http://thecodefarm.com Tel: (+34) 945 06 55 09 -- 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 unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Problem with Django webserver on HP
http://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-ipaddr-port Try with python manage.py runserver 0.0.0.0:8000 2010/1/28 rajk > > HP-UX B.11.00 > Django-1.1.1 > > myhost:/home/root/MyPython> python > ActivePython 2.6.4.8 (ActiveState Software Inc.) based on > Python 2.6.4 (r264:75706, Nov 3 2009, 13:55:48) [C] on hp-ux11 > Type "help", "copyright", "credits" or "license" for more information. > >>> import django > >>> django.VERSION > (1, 1, 1, 'final', 0) > >>> exit() > > r...@myhost:/home/root/MyDjango> cd testproject > r...@myhost:/home/root/MyDjango/testproject>ls > _init_.py _init_.pyc manage.py settings.py settings.pyc urls.py > r...@myhost:/home/root/MyDjango/testproject> python manage.py > runserver > Validating models... > 0 errors found > > Django bersion 1.1.1, using settings 'testproject.settings' > Development server is running at http://127.0.0.1:8000/ > Quit the server with CONTROL-C. > > Now, open Mozilla browser and enter http://127.0.0.1:8000/ > > Here is the PROBLEM which some one from the user group can resolve for > me .. > Nothing happens in the browser > A core file is in the r...@myhost:/home/root/MyDjango/testproject > directory > > Please advise and help - Thanks, kair...@coned.com > > -- > 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 unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Benito Jorge Bastida jo...@thecodefarm.com thecodefarm SL Av. Gasteiz 21, 1º Derecha 01008 Vitoria-Gasteiz http://thecodefarm.com Tel: (+34) 945 06 55 09 -- 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 unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Problem with Django webserver on HP
Note that the default IP address, 127.0.0.1, is not accessible from other machines on your network. To make your development server viewable to other machines on the network, use its own IP address (e.g. 192.168.2.1) or 0.0.0.0. >From any other computer in your network the url will be server/yours ip. http://server-ip:8000/ -- Benito Jorge Bastida jo...@thecodefarm.com thecodefarm SL Av. Gasteiz 21, 1º Derecha 01008 Vitoria-Gasteiz http://thecodefarm.com Tel: (+34) 945 06 55 09 -- 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 unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Dajaxice and geodjango problem
Hello Alexis, Dajaxice returns DAJAXICE_EXCEPTION if your ajax function (maps.ajax.sendRoute) raises any Exception. Try to set DAJAXICE_DEBUG=True and see the server console or try:except: the code inside your ajax function to see what Exception was raised Hope it helps you. 2010/2/3 Alexis Selves > Hey there, > I have problem with dajaxice. I am trying to save vertex from google > route to my db. > Call of JS function: > Dajaxice.maps.sendRoute('sendRoute_callBack',{'data':array}); > > function sendRoute_callBack(data){ >if(data!='DAJAXICE_EXCEPTION'){ >alert(data.message); >} >else{ > >alert('Error'); >} >} > > Problem is that I always get Error. > > Admin.py: > from django.utils import simplejson > from django.contrib.gis.geos import Point,Multipoint > from maps.models import Route > > def sendRoute(request, data, name): >mp=MultiPoint() >counter = 0 >for coord in data: >if counter == 0: >lng=coord >elif counter == 1: >lat=coord >p = Point(lng,lat) >mp.append(p) >counter=0 >route = Route() >route.name=name >route.coordinates=mp; >route.save() > > return simplejson.dumps({'message':'Data stored' }) > > > I don't know what to do.. Can anyone help me... > > -- > 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 unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Benito Jorge Bastida jo...@thecodefarm.com thecodefarm SL Av. Gasteiz 21, 1º Derecha 01008 Vitoria-Gasteiz http://thecodefarm.com Tel: (+34) 945 06 55 09 -- 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 unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Dajaxice and geodjango problem
What version of dajaxice are you using? The server console hasn't got any output? Try to print out the logging info: import logging logging.basicConfig(level=logging.DEBUG) 2010/2/3 Alexis Selves > Hello DAJAXICE_DEBUG = True > in my settings.py is set already.. > > On 3 ún, 20:22, Jorge Bastida wrote: > > Hello Alexis, > > Dajaxice returns DAJAXICE_EXCEPTION if your ajax function > > (maps.ajax.sendRoute) raises any Exception. > > Try to set DAJAXICE_DEBUG=True and see the server console or try:except: > the > > code inside your ajax function to see what Exception was raised > > > > Hope it helps you. > > > > 2010/2/3 Alexis Selves > > > > > > > > > Hey there, > > > I have problem with dajaxice. I am trying to save vertex from google > > > route to my db. > > > Call of JS function: > > > Dajaxice.maps.sendRoute('sendRoute_callBack',{'data':array}); > > > > > function sendRoute_callBack(data){ > > >if(data!='DAJAXICE_EXCEPTION'){ > > >alert(data.message); > > >} > > >else{ > > > > >alert('Error'); > > >} > > >} > > > > > Problem is that I always get Error. > > > > > Admin.py: > > > from django.utils import simplejson > > > from django.contrib.gis.geos import Point,Multipoint > > > from maps.models import Route > > > > > def sendRoute(request, data, name): > > >mp=MultiPoint() > > >counter = 0 > > >for coord in data: > > >if counter == 0: > > >lng=coord > > >elif counter == 1: > > >lat=coord > > >p = Point(lng,lat) > > >mp.append(p) > > >counter=0 > > >route = Route() > > >route.name=name > > >route.coordinates=mp; > > >route.save() > > > > > return simplejson.dumps({'message':'Data stored' }) > > > > > I don't know what to do.. Can anyone help me... > > > > > -- > > > 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 unsubscribe from this group, send email to > > > django-users+unsubscr...@googlegroups.com > > > > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/django-users?hl=en. > > > > -- > > Benito Jorge Bastida > > jo...@thecodefarm.com > > > > thecodefarm SL > > Av. Gasteiz 21, 1º Derecha > > 01008 Vitoria-Gasteizhttp://thecodefarm.com > > Tel: (+34) 945 06 55 09 > > -- > 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 unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Benito Jorge Bastida jo...@thecodefarm.com thecodefarm SL Av. Gasteiz 21, 1º Derecha 01008 Vitoria-Gasteiz http://thecodefarm.com Tel: (+34) 945 06 55 09 -- 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 unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: kss with django
Take a look to http://dajaxproject.com/ Hope this helps you 2010/2/4 Vranesic Ogi > Am Donnerstag 04 Februar 2010 15:39:21 schrieb bruno desthuilliers: > > On Feb 4, 10:32 am, ogi wrote: > > > Hi > > > > > > I'm new in Django but rather old in Python. > > > I followed the tutorialhttp://code.djangoproject.com/wiki/KSSInDjango > > > to integrate KSS with Django and installed kss.django > > > did all settings. > > > But in views.py after > > > commands = KSSCommands() > > > commands.core.replace... > > > I got attribute error 'core' > > > Any hint will be very appreciated. > > > > I suspect the tutorial is either wrong or not up to date. Anyway, this > > is a KSS problem, not a Django problem, so you may have better luck > > searching in KSS documentation, website or whatever. > > > > Yeps, not very helpful, I know - sorry :-/ > > > Bruno thanks anyway for reply. > > Does somebody know which AJAX is the best for Django - jQuery, JSON or > something similar (KSS not any more?). > So I can search for instructions. > > Best regards > Ogi > > -- > 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 unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Benito Jorge Bastida jo...@thecodefarm.com thecodefarm SL Av. Gasteiz 21, 1º Derecha 01008 Vitoria-Gasteiz http://thecodefarm.com Tel: (+34) 945 06 55 09 -- 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 unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: UK-based Django Host?
Linode 512 here, excellent service. 2011/5/25 Stuart MacKay > I use a Linode 512 VPS hosted in London. So far it has been awesome. > > Stuart MacKay > Lisbon, Portugal > > > I know this question has been asked before, but the most recent thread >> I can find in the archives is from 2007, and presumably the landscape >> has changed since then. >> >> I'm looking for a Webfaction-like host with servers in the UK. It >> needs to allow long-running processes, of course, and would ideally be >> (like Webfaction) fully managed. (We don't have the staff to keep a >> server updated or tuned). We need plenty of memory, shell access (of >> course), and preferably mod_wsgi. >> >> Does anyone have any recommendations of hosts they've worked with? >> >> Thanks! >> -Nan >> >> > -- > 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 email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- 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 email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Full text search with PostgreSQL and Django
http://haystacksearch.org/ 2010/12/17 marcoarreguin > Hi!! > > I need to implement a search engine with full text search, I'm using > postgreSQL and Django, I have searched in google ( > http://barryp.org/blog/entries/postgresql-full-text-search-django/ ) > but isn't there a more simple way ?? > > Or just another way? > > -- > 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 unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Benito Jorge Bastida jo...@thecodefarm.com thecodefarm SL Av. Gasteiz 21, 1º Derecha 01008 Vitoria-Gasteiz http://thecodefarm.com Tel: (+34) 945 06 55 09 -- 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 unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Dajaxice Unresolved Import
> > Does anyone know if it matters what version I install of these > packages? > (I'm using version 2.6.6 of python and 1.2.3-1ubuntu0.2.10.10.1 of > python-django.) Hi, Probably the problem is that you are using an old django-dajaxice version. 0.1.5 had some bugs related to the function registration that were fixed in 0.1.6 Try to upgrade it to a newer version (0.1.8) https://github.com/jorgebastida/django-dajaxice/downloads Cheers, -- 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 email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: A very simple dajax code to show alert window not working
Hi, You should include your desired Dajax implementation. You can choose between Prototype, jquery, dojo etc... The django-dajax installation steps are here [1]. As you can see in one of the final steps "Include dajax in your ", you should add a new script line to include that JS, also you should include that JS Framework :) Hope this help you. Regards. [1] https://github.com/jorgebastida/django-dajax/wiki/Installation 2011/3/29 Abhijeet Rastogi > Hi, > > I am beginner in django and dajax. In the process of learning to use dajax > I am trying to simply display an alert saying "Foo". > > My code: https://bitbucket.org/shadyabhi/learnajax/src > > The above code contains 2 input boxes. The first one works but second one > says "Dajax is not defined". > I am not able to figure out what is the issue. > I tried making the above code using http://www.dajaxproject.com/multiply/.In > that, Dajax.process is send as parameter to function. Where is the > documentation for that particular thing? > > It would be great if I could get a prompt reply as my project is on hold > due to this AJAX stuff. Thanks. > > My ajax.py looks like: > def showalert(request): > dajax = Dajax() > dajax.alert("foo") > return dajax.json() > > And relevant template code is > function alertshow(){ >Dajaxice.example.showalert(Dajax.process) >} > onclick="alertshow()"> > > -- > Regards, > Abhijeet Rastogi (shadyabhi) > http://www.google.com/profiles/abhijeet.1989 > > -- > 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 email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- 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 email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: A very simple dajax code to show alert window not working
Hi, There isn't any other methods, Dajax.process is only a callback that "understand" what Dajax return as response. You can check the code here [1]. Regards. [1] https://github.com/jorgebastida/django-dajax/blob/master/src/jquery.dajax.core.js 2011/3/29 Abhijeet Rastogi > Thanks Jorge. Worked perfectly. > I included jquery.dajax.core.js and jquery.js in the document and now > everything works perfectly. > > btw, I couldnt find documentation for Dajax.process method. Like there > there might me other methods too. Where can I find the documentation for > them. > > > On Wed, Mar 30, 2011 at 1:01 AM, Jorge Bastida wrote: > >> Hi, >> >> You should include your desired Dajax implementation. You can choose >> between Prototype, jquery, dojo etc... >> >> The django-dajax installation steps are here [1]. As you can see in one of >> the final steps "Include dajax in your ", you should add a new script >> line to include that JS, also you should include that JS Framework :) >> >> > type="text/javascript" charset="utf-8"> >> >> Hope this help you. >> >> Regards. >> >> >> [1] https://github.com/jorgebastida/django-dajax/wiki/Installation >> >> 2011/3/29 Abhijeet Rastogi >> >>> Hi, >>> >>> I am beginner in django and dajax. In the process of learning to use >>> dajax I am trying to simply display an alert saying "Foo". >>> >>> My code: https://bitbucket.org/shadyabhi/learnajax/src >>> >>> The above code contains 2 input boxes. The first one works but second one >>> says "Dajax is not defined". >>> I am not able to figure out what is the issue. >>> I tried making the above code using >>> http://www.dajaxproject.com/multiply/ .In that, Dajax.process is send as >>> parameter to function. Where is the documentation for that particular thing? >>> >>> It would be great if I could get a prompt reply as my project is on hold >>> due to this AJAX stuff. Thanks. >>> >>> My ajax.py looks like: >>> def showalert(request): >>> dajax = Dajax() >>> dajax.alert("foo") >>> return dajax.json() >>> >>> And relevant template code is >>> function alertshow(){ >>>Dajaxice.example.showalert(Dajax.process) >>>} >>> >> onclick="alertshow()"> >>> >>> -- >>> Regards, >>> Abhijeet Rastogi (shadyabhi) >>> http://www.google.com/profiles/abhijeet.1989 >>> >>> -- >>> 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 email to >>> django-users+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/django-users?hl=en. >>> >> >> > > > -- > Regards, > Abhijeet Rastogi (shadyabhi) > http://www.google.com/profiles/abhijeet.1989 > -- 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 email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Rendering only a portion of the page
Hi Lj, > I am building a django web app that has a control panel with various > icons. Right now, the icons have href tags that load a new page when > the user clicks the icon. I want to change this to instead call a > jQuery function that will use ajax, or dajaxice, to render only the > content part of the page. > Does this sound possible? > Yes, absolutely. > Would this be easier to do with Dajaxice, or with jQuery functions? > Could I still use django templates for the content that corresponds > with each icon? In every panel icon, you should register an onclick event and call your registered dajaxice function or instead use jQuery to call your own view. That dajaxice function or your own view should return the html content that you want to show. How? probably rendering that code using render_to_string [1] [1] http://docs.djangoproject.com/en/dev/ref/templates/api/#the-render-to-string-shortcut Hope this helps you, Jorge Bastida. -- 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 email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Dajax, what do you think about it?
Hi Sameer, > What do you think about using Dajax and Dajaxice in Django? is it worth? or > you like to write your own ajax code? Probably the answer is... "It depends". If you have 2 o 3 ajax functions and you doesn't want to add another dependency, probably you should create your own views and call them from your favorite JS framework (jQuery, Prototype... ). Instead if you have tons of ajax functionality in your project probably dajaxice could help you saving time creating tons of urls and provides you an uniform way of doing that stuff, handling erros, debugging... Hope this helps you, Jorge Bastida. -- 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 email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.