Re: Javascript frameworks with Django

2011-04-27 Thread Jani Tiainen
This is exactly like I've done it in the past and it's problematic. Specially 
with lazy loading features. (Though I haven't upgraded my apps to use 1.3 
style media serving that could ease whole thing)

One problem is that I need some dynamic parts for otherwise static JS code. 
Let's take an example, a simple "login" form.


var form = new Ext.widget('form', {
items: [{
xtype: 'textfield',
fieldLabel: '{% trans "Username" %}',
name: 'username'
},{
xtype: 'textfield',
fieldLabel: '{% trans "Password" %}',
name: 'password'
   }],
   buttons: [{
   text: '{% trans "Login" %}',
   handler: function() {
   this.up('form').getForm().submit({
   url: '{% url login_view %}'   
   });
   }
   }]
  });


As seen on above example, there is small parts (translations) and the most 
important - url.

And I've tens of forms like above (of course way more complex forms). In 
"biggest" application there is a bit over 50 different forms. And that's where 
dynamic loading comes quite handy. System loads only what is needed on demand.

So I can't put everything in static files nor it wouldn't make point to put 
everything in templates either.

So how to make it work without too much pain?

Oh, let me clear up one thing.

When I declare these files one of the key features is to use "require" 
functionality. In pseudo-code it works like this:

Require('My.fancy.class');

That is translated roughly to:

/fancy/class.js

For example if I've declared location of "My" as /static/ system would 
construct url: /static/fancy/class.js

Hope that this cleared up my "problem".

On Wednesday 27 April 2011 18:01:57 christian.posta wrote:
> I'm not sure I completely understand your question, but let me provide
> an answer and maybe that'll get us started on the right track.
> 
> For the dynamic parts of the application, you could absolutely use
> django and view methods/classes to return json/xml or whatever data
> format you use. The data can then be rendered by your front-end JS
> code. You probably won't need the django templates unless you're
> formatting data a certain way.
> 
> Your static code (you mean static media like javascript, css, and
> images, right?) should ultimately be served by a different server,
> specifically set up for static content (see the django docs... they
> mention this). To implement the static URL, use either the
> 'staticfiles' app for django 1.2.x or use the built in static files
> for django 1.3.
> 
> HTH
> 
> On Apr 27, 12:50 am, Jani Tiainen  wrote:
> > Hi,
> > 
> > I've been for a while been using ExtJS and Dojotoolkit. Specially very
> > recently released ExtJS 4 brought lot of interesting features including
> > loading on demand (Dojotoolkit had it for a good while).
> > 
> > Now I'm facing good practice problem:
> > 
> > I want to construct apps that relies pretty much solely on "web 2.0"
> > technologies, namely to rewrite desktop apps in a web.
> > 
> > There comes the "problem". To make things work smooth browser side
> > javascript code needs to talk to Django views and to make that happen I
> > need to get URLs working (and later on translations).
> > 
> > How to make all that work together well? I mean where to put dynamic
> > parts, where to put static parts and at some day - translations.
> > 
> > Should I mix and match templates and plain static javascripts? One
> > problem that I've been facing (though 1.3 probably fixed it) was
> > resources from different apps, specially static js parts.
> > 
> > --
> > 
> > Jani Tiainen

-- 
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.



Getting reStructuredText to work in admindocs

2011-04-27 Thread Mike Edwards
Hi all!

I'm having a really tough time getting reStructuredText to work in the
admindocs application.  I've installed docutils with pip, but
everything I see in my model details documentation under admin/docs/
is rendered as the original text, not converted to links and HTML
formatting.  So, when I write the following in models.py:

class Article(models.Model):
"""
This ``Article`` is related to :model:`iprotocms.category`

"""

It shows up literally as:

This ``Article`` is related to :model:`iprotocms.category`

Any idea why this would be?  Is there some odd middleware or context
processor that I've missed?

-Mike

-- 
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: inlineformset_factory and many-to-many relationships

2011-04-27 Thread Kenny Meyer
Hi Rosemarie,

Try a quick google search with terms like "django  has no ForeignKey to " and you'll get a bunch of results. I promise.

Here's only one of those results:
http://stackoverflow.com/questions/609556/django-admin-inlining-foreign-key-issue

AFAICS this issue has been discussed various times here on this
mailing-list. Again, Google search engine is an awesome thing :)

Kenny



On Wed, Apr 27, 2011 at 4:47 PM, Rosemarie
 wrote:
> Oh yeah, and the exact error I am currently getting is
> Exception at /members/edit/
>  has no ForeignKey to  'member.models.member'>
>
> --
> 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.



weird error on admin index

2011-04-27 Thread Pascal Moutia
Hi django users

I'm trying to start my admin section of my django site but i always got an 
error apparently with the admin template, but i never touched it,

there is the error:

TemplateSyntaxError at /admin/

Caught AttributeError while rendering: 'ListView' object has no attribute 
'rindex'


Does any one got that error before ? 

thanks for your help :D

-- 
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: Running tests automatically as you work.

2011-04-27 Thread Kenny Meyer
Thanks for sharing! Very useful, indeed.

The sleep() in your script is pretty clever, as I also tend to save
files pretty frequently.


On Wed, Apr 27, 2011 at 5:58 PM, Shawn Milochik  wrote:
> http://dpaste.com/hold/536487/
>
> I cobbled this little script together that monitors my project folder and
> runs tests every time a .py file is saved. I'm sharing it in case anyone is
> interested. Feedback is welcome, of course.
>
> Interesting bits:
>
>    pyinotify: This module plugs into kernel notifications so you don't have
> to do something horrible like put os.walk in a loop.
>
>    call_command: Kenny Meyer pointed this out to me. It lets you run
> 'manage.py' commands from a Python script.
> http://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code
>
>    SystemExit: When sys.exit() is called, you can't catch it with "except
> Exception," because it has a different base class.
>        Thanks to Alex Gaynor for helping me with this one.
>
> --
> 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.



Running tests automatically as you work.

2011-04-27 Thread Shawn Milochik

http://dpaste.com/hold/536487/

I cobbled this little script together that monitors my project folder 
and runs tests every time a .py file is saved. I'm sharing it in case 
anyone is interested. Feedback is welcome, of course.


Interesting bits:

pyinotify: This module plugs into kernel notifications so you don't 
have to do something horrible like put os.walk in a loop.


call_command: Kenny Meyer pointed this out to me. It lets you run 
'manage.py' commands from a Python script.

http://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code

SystemExit: When sys.exit() is called, you can't catch it with 
"except Exception," because it has a different base class.

Thanks to Alex Gaynor for helping me with this one.

--
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: inlineformset_factory and many-to-many relationships

2011-04-27 Thread Rosemarie
ahh, and
class MemberForm(ModelForm):
   class Meta:
  model = member
  exclude =
('password','date_joined','username','is_staff','is_active','last_login','is_superuser','firstAid')


it has the class Meta:
that's not the problem.  Sorry, I'm all over the place here!

-- 
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: Running Django tests from Python

2011-04-27 Thread Shawn Milochik

On 04/27/2011 04:06 PM, Kenny Meyer wrote:

Hi Shawn,

http://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code

Does this answer your question?

Kenny


Never mind. More pdb action and I figured out that I had overwritten 
DJANGO_SETTINGS_MODULE at the bash prompt I was using to try this. All 
my fault. Yay.


Now it works, thanks.

Shawn


--
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: Running Django tests from Python

2011-04-27 Thread Shawn Milochik

On 04/27/2011 04:06 PM, Kenny Meyer wrote:

Hi Shawn,

http://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code

Does this answer your question?

Kenny


Kenny,

This is *exactly* what I was looking for.

Unfortunately it doesn't work. It keeps saying that an app with that 
label can not be found.


I've traced it down to django.db.models.loading.py, which imports 
settings from django.conf, but it's
always 'django.conf.LazySettings object' instead of the proper settings 
file.


This is odd, because os.environ['DJANGO_SETTINGS_MODULE'] is properly 
set if I check it in pdb during that function.


I've even tried passing my settings module as a kwarg as described in 
the doc you sent which doesn't work either.

In any case, I'm using the default -- 'settings.py' in the project folder.

Any ideas?

Thanks,
Shawn

--
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: inlineformset_factory and many-to-many relationships

2011-04-27 Thread Rosemarie
Oh yeah, and the exact error I am currently getting is
Exception at /members/edit/
 has no ForeignKey to 

-- 
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.



inlineformset_factory and many-to-many relationships

2011-04-27 Thread Rosemarie
ahh, feeling very frustrated, hopefully someone can enlighten me :)

-Creating a form to edit a "member" model
-Member has a few many-to-many relationships.
-I was initially getting an error about not being able to update m2m
unless you use the manager for the other table
-After googling, I found info on using inlineformset_factory
-Now I'm getting a new error about how the member model doesn't have
any fk to the firstAid model (firstAid being the m2m table that I'm
trying to relate to)
-I'm using a custom intermediate model for firstAid
-However, even when I try this with a different m2m attribute that
just uses django's default intermediate model, it gives me the same
error.

---
Code for models.py (shortened to relevant parts only :P )

class vehicle(models.Model):
   key =
models.CharField('Key',max_length=6,null=True,blank=True,editable=True)
   value =
models.CharField('Name',max_length=25,null=True,blank=True,editable=True)
   description =
models.TextField('Description',null=True,blank=True,editable=True)

class firstAid(models.Model):
   key =
models.CharField('Key',max_length=6,null=True,blank=True,editable=True)
   value =
models.CharField('Name',max_length=65,null=True,blank=True,editable=True)
   term =
models.IntegerField('Term',null=True,blank=True,editable=True)
   patientCare = models.NullBooleanField('Patient
Care',editable=True,blank=True)

class rank(models.Model):
   key =
models.CharField('Key',max_length=12,null=True,blank=True,editable=True)
   value = models.TextField('Name',null=True,blank=True,editable=True)
   prefix =
models.CharField('Prefix',max_length=25,null=True,blank=True,editable=True)


class member(User):
   driverQual = models.ManyToManyField(vehicle,blank=True,null=True)
   firstAid =
models.ManyToManyField(firstAid,blank=True,null=True,through='firstAidQualifiers')
   rank = models.ForeignKey(rank,blank=True,null=True)

class firstAidQualifiers(models.Model):
   m = models.ForeignKey(member)
   fa = models.ForeignKey(firstAid)
   date_obtained = models.DateField()


-

Code for forms.py
class MemberForm(ModelForm):
   model = member
   exclude =
('password','date_joined','username','is_staff','is_active','last_login','is_superuser','firstAid')

-

Code for views.py

def editMember(request):
   try:
  x = request.GET.get('member', '')
   except:
  x = ''
   if x == '':
  return HttpResponseRedirect('/member-list/')


   m = member.objects.get(username=x)
   form = MemberForm(instance = m)
   FirstAidFormset = inlineformset_factory(member, firstAid)


   if request.method == 'POST':
form = MemberForm(request.POST, request.FILES,instance=m)
formset = FirstAidFormset(request.POST,
request.FILES,instance=m)
if formset.is_valid():
formset.save()

   else:
form = MemberForm(request.POST, request.FILES,instance=m)
formset =
FirstAidFormset(request.POST,request.FILES,instance=m)

   return render_to_response("edit-member.html", {
'formset': formset, 'form' : form, 'request' : request, 'm' :
m, 'instance' : m }, context_instance=RequestContext(request))



---
I realize this is a ton of code and is probably too annoying to even
begin to troubleshoot for me but if you have any thoughts or if I'm
*obviously* doing something wrong, I'd appreciate any insight! :)

-- 
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.



Senior Web Apps Developer - Pasadena, CA Area

2011-04-27 Thread AceGerard
Senior Web Application Developer - Major Parts Distribution –
Pasadena, CA Area



Experience at a high traffic web property preferred (100,000+ page
views a day – Pricegrabber, eHarmony, Disney, MySpace, Google, Yahoo,
etc.)  Experience in more than one area at said high traffic site
preferred.



Languages / Frameworks



Experience with Python (Django Framework), JavaScript UI (Dojo
Toolkit) preferred.  Some experience with PHP is a plus.  Experience
with any open source scripting language for web development (Perl,
PHP, Python, Ruby) considered.  No candidates who have worked
*exclusively* with Java or .NET, and haven’t touched open source at
all.



Data Awareness



Experience working with data heavy applications required.  Strong
knowledge of MySQL or PostgreSQL databases highly desired.



Environment



High level of comfort in Linux or UNIX operating systems required.



Other Requirements



Some experience with some other kind of open source technology:
memcached, beanstalkd, Lucerne / Apache Solr, Sphinx Search, MongoDB,
CouchDB, watir, Selenium, nginx, Cassandra, Infobright, Greenplum,
anything else …  Experience with Subversion (SVN) or git preferred.



1.  What high-traffic websites have you worked on, and for how long?

2.  How extensive is your open-source web development in skills like
LAMP and Python?

3. What's your most significant website development achievement in the
past 5 years?



Jerry Witt | Technical Recruiter | netPolarity
office: 408-971-4555   mobile: 303-915-9667

Toll Free 1-866-971-6911 x303
jer...@netpolarity.com | www.netpolarity.com



www.linkedin.com/in/jerrywwitt

-- 
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: Running Django tests from Python

2011-04-27 Thread Kenny Meyer
Hi Shawn,

http://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code

Does this answer your question?

Kenny



On Wed, Apr 27, 2011 at 12:41 PM, Shawn Milochik  wrote:
> Sorry, I realize that last post is missing the context of the original
> question.
> Please see
> this: https://groups.google.com/d/topic/django-users/-4f3J1bJ10k/discussion
> Thanks,
> Shawn
>
> --
> 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: Error performing rar file download.

2011-04-27 Thread Cal Leeming [Simplicity Media Ltd]
So, let me get this straight.

You are trying to serve a 299mb file, directly from your webapp instance?

I'm just gonna come right out and say it... what you are doing is pretty
stupid. I'd look into doing things properly (i.e. serving it from a real web
server) rather than trying to resolve this problem.

PS) The reason you are getting a MemoryError, is because your webapp
instance is trying to buffer up 299MB of data to send to the client. Not
cool.


On Wed, Apr 27, 2011 at 7:34 PM, Elton Pereira  wrote:

> 299MiB
>
> On Wed, Apr 27, 2011 at 11:31 AM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> ... dare I ask, how big is the file?
>>
>> Cal
>>
>> On Wed, Apr 27, 2011 at 3:20 PM, Elton Pereira wrote:
>>
>>> When attempting to download a zip file the following error is raised:
>>>
>>> 192.168.1.39 - - [27/Apr/2011 11:12:35] "GET /media/downloads/betha/
>>> essencial/sybase9/windows32/win32.rar HTTP/1.1" 500 -
>>> Traceback (most recent call last):
>>>  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/
>>> basehttp.py", line 674, in __call__
>>>return self.application(environ, start_response)
>>>  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
>>> wsgi.py", line 252, in __call__
>>>response = middleware_method(request, response)
>>>  File "/usr/local/lib/python2.6/dist-packages/django/middleware/
>>> gzip.py", line 35, in process_response
>>>response.content = compress_string(response.content)
>>>  File "/usr/local/lib/python2.6/dist-packages/django/utils/text.py",
>>> line 183, in compress_string
>>>zfile.write(s)
>>>  File "/usr/lib/python2.6/gzip.py", line 197, in write
>>>self.fileobj.write( self.compress.compress(data) )
>>> MemoryError
>>>
>>> NOTE: any other file I can download normally, the error only happens
>>> with RAR files.
>>>
>>> --
>>> 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.
>>>
>>>
>>
>
>
> --
> Elton Pereira de Lima
> Linux System Administrator
> Django Developer
> -
> Seja transparente! Use Software Livre!
>
> Atenção: Este e-mail pode conter anexos no formato ODF (Open Document
> Format)/ABNT (extensões odt, ods, odp, odb, odg). Antes de pedir os
> anexos em outro formato, você pode instalar gratuita e livremente o
> BrOffice (http://www.broffice.org) ou o seguinte Plugin para Microsoft
> Office (http://www.sun.com/software/star/odf_plugin/get.jsp).
>
> Você que paga propina, joga lixo no chão, fura fila, sonega impostos,
> estaciona em vagas p/ deficientes... *NÃO PODE FALAR MAL DOS POLÍTICOS*!
>
>

-- 
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: Unexpected error

2011-04-27 Thread Czare1
Unfortunately I can't reproduce it. It happens sometimes on production
environment. It disappears as soon as django processes are restarted.

On 27 Kwi, 16:51, Shawn Milochik  wrote:
> If you know how to cause this error, run manage.py shell and import or
> instantiate whatever you have to in order to make this happen.
>
> The traceback you get there will be more useful.
>
> Shawn

-- 
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: Running Django tests from Python

2011-04-27 Thread Shawn Milochik
Sorry, I realize that last post is missing the context of the original 
question.

Please see 
this: https://groups.google.com/d/topic/django-users/-4f3J1bJ10k/discussion

Thanks,
Shawn

-- 
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: Running Django tests from Python

2011-04-27 Thread Shawn Milochik
I figure it's been long enough that I can bump this post.

I'm currently using subprocess to do this. There must be an easy way to 
simply invoke the tests from within Python.

So, how do you (within Python), do the equivalent of the following?:
./manage.py test myapp1, myapp2, myapp3

Thanks,
Shawn

-- 
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: User Profile and Form initial values

2011-04-27 Thread James
Doh! As much as I read in the forms section, I skipped the ModelForms part, 
even though that's what I was using!

Thanks again!

James

-- 
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: Javascript frameworks with Django

2011-04-27 Thread Shawn Milochik
In my experience you almost definitely do want to take advantage of 
templates. It makes things a lot easier.


Simple example:

A main template (including things like the  and  tags 
and doctype).


A detail template that just includes, say, a table of results.

In action:

The user takes action on the page.

JavaScript does an AJAX call, which hits your Django view.

The Django view returns a rendered template.

The JavaScript callback function replaces a portion of the DOM with 
that response.


Simple jQuery example of this:
$.ajax({
url: url_to_your_view,
type: "POST",
data: $("#search_form").serialize()
success: function(data){ $("#results_pane").html(data);},
});


Of course, you will probably have other bits and pieces of AJAX that 
deal with JSON and change other aspects of the page, but for the 
requirement of simulating a desktop application you will definitely have 
a much easier time with it if you use templates as much as possible 
instead of using JavaScript to dynamically write all your HTML.


Shawn


--
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: How can I force a browser to cache my view?

2011-04-27 Thread Oliver Andrich
Hi Javier,

2011/4/27 Javier Guerra Giraldez 

> On Wed, Apr 27, 2011 at 10:48 AM, Oliver Andrich
>  wrote:
> > So, I was looking into possible solutions. As you can't download anything
> > via ajax directly, you have to trick the browser into caching it and then
> > "download" the cached version.
>
> can't you create an invisible iframe and do the download there?
> (disclaimer, i haven't tried that myself, just done similar things for
> uploads)
>

Thanks, that works like a charm and is much easier to implement.

Best regards,
Oliver

-- 
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: How can I force a browser to cache my view?

2011-04-27 Thread Javier Guerra Giraldez
On Wed, Apr 27, 2011 at 10:48 AM, Oliver Andrich
 wrote:
> So, I was looking into possible solutions. As you can't download anything
> via ajax directly, you have to trick the browser into caching it and then
> "download" the cached version.

can't you create an invisible iframe and do the download there?
(disclaimer, i haven't tried that myself, just done similar things for
uploads)

-- 
Javier

-- 
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: How can I force a browser to cache my view?

2011-04-27 Thread Oliver Andrich
Hi,

2011/4/27 christian.posta 

> You're trying to cache a pdf file/attachment? why? What's the purpose
> of trying to do it that way? Why don't you just send it to the client

when they ask for it?
>

Well, basically the reason is, that I want to show a progress dialog or
"meanwhile" dialog to the user, cause the pdf is created on demand and this
can take between 2-60 seconds, depending on the complexy of the newspaper
page. Yes, I can provide a simple download link and let the browser show its
wait cursor. But sadly, this is not enough for my users.

So, I was looking into possible solutions. As you can't download anything
via ajax directly, you have to trick the browser into caching it and then
"download" the cached version.

Currently, I am looking into a solution based on a onload event listener.


> Also, there's no way on the server to 'force' content to be cached on
> the client. The browser has to specifically allow it. All I can think
> of is the browser needs to set if_modified_since headers in the
> request for the server to respond with a 304, but I've never tried to
> cache a pdf file or attachment.
>

Already tried it, and it hasn't worked at all.

Best regards,
Oliver

-- 
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.



Mysql NDB Cluster

2011-04-27 Thread pavera
Due to strangeness in the way mysql NDB Cluster works, select queries
using a primary key or unique field in the where clause create a read
lock for the duration of the connection...

IE in a python shell:
In [2]: from django.contrib.auth.models import User

In [3]: user = User.objects.get(username='myuser')

will lock the row in the database for the duration of the python shell
(IE he can't log in via the web anymore, or perform any action that
will cause an update statement to his user row)

If I commit after the select, then the problem goes away.
IE:

In [1]: from django.db import connection
In [2]: from django.contrib.auth.models import User

In [3]: user = User.objects.get(username='myuser')
In [4]: connection.commit()

After the commit, the user can now perform whatever action he desires
via the web

So, the question is, is this an error in the django mysql backend that
it is assuming mysql is auto commiting, when in reality it is not
(because the NDB storage engine doesn't work like myisam)?  I don't
know the inner workings of the db backends/transaction management well
enough to understand what is supposed to happen.  I think its crazy
that mysql ndb requires a commit after a select to release a lock...
but... such is the infrastructure I'm stuck using.  Essentially
though, if you're using mysql ndb cluster you have to issue a commit
after every select to clear the locks on the rows selected.  Any
information/insight would be greatly appreciated.

-- 
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: Javascript frameworks with Django

2011-04-27 Thread christian.posta
I'm not sure I completely understand your question, but let me provide
an answer and maybe that'll get us started on the right track.

For the dynamic parts of the application, you could absolutely use
django and view methods/classes to return json/xml or whatever data
format you use. The data can then be rendered by your front-end JS
code. You probably won't need the django templates unless you're
formatting data a certain way.

Your static code (you mean static media like javascript, css, and
images, right?) should ultimately be served by a different server,
specifically set up for static content (see the django docs... they
mention this). To implement the static URL, use either the
'staticfiles' app for django 1.2.x or use the built in static files
for django 1.3.

HTH

On Apr 27, 12:50 am, Jani Tiainen  wrote:
> Hi,
>
> I've been for a while been using ExtJS and Dojotoolkit. Specially very
> recently released ExtJS 4 brought lot of interesting features including
> loading on demand (Dojotoolkit had it for a good while).
>
> Now I'm facing good practice problem:
>
> I want to construct apps that relies pretty much solely on "web 2.0"
> technologies, namely to rewrite desktop apps in a web.
>
> There comes the "problem". To make things work smooth browser side javascript
> code needs to talk to Django views and to make that happen I need to get URLs
> working (and later on translations).
>
> How to make all that work together well? I mean where to put dynamic parts,
> where to put static parts and at some day - translations.
>
> Should I mix and match templates and plain static javascripts? One problem
> that I've been facing (though 1.3 probably fixed it) was resources from
> different apps, specially static js parts.
>
> --
>
> Jani Tiainen

-- 
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: How can I force a browser to cache my view?

2011-04-27 Thread christian.posta
Hi,

You're trying to cache a pdf file/attachment? why? What's the purpose
of trying to do it that way? Why don't you just send it to the client
when they ask for it?

Also, there's no way on the server to 'force' content to be cached on
the client. The browser has to specifically allow it. All I can think
of is the browser needs to set if_modified_since headers in the
request for the server to respond with a 304, but I've never tried to
cache a pdf file or attachment.

On Apr 27, 12:44 am, Oliver Andrich  wrote:
> Hi,
>
> I have a problem getting the browser to cache the data returned by my view.
> The basic idea behind this is, I want to download the data via ajax to
> provide a progress dialog and afterwards I set document.location.href to the
> same url and use the cached data. last_modified sets the last modified
> header as expected. The creation also behaves like expected. The line
> "document.location.href = href + '?timestamp=' + timestamp" creates a second
> GET for my view, but I get a 200 http code instead of a 304. And if I look
> at my browser cache contents, I can see, that my data is not cashed at call.
> The caching even doesn't if I open the url in the browser directly.
>
> Can I force the browser to cache my data?
>
> Best regards,
> Oliver
>
> My Django view:
>
> @login_required
> @redweb_view
> @last_modified(last_modified_func)
> def show_pdf(request, page_id, quality):
>     page = Page.objects.get(pk=page_id)
>     with create_client_from_request(request).create_session() as s:
>         pdf_data = s.print_element(page_id, image_quality=quality)
>     response = HttpResponse(mimetype='application/pdf')
>     response['Content-Disposition'] = 'attachment; filename=%s.pdf' %
> page.name
>     response.write(pdf_data)
>     return response
>
> My Javascript code:
>
>             var timestamp = new Date().getTime();
>             $.get(href + '?timestamp=' + timestamp).success(function() {
>                 document.location.href = href + '?timestamp=' + timestamp;
>             });

-- 
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.



Upgrade to Django-1.3 seeing AttributeError: 'NoneType' object has no attribute '_info'

2011-04-27 Thread Bryan
I just downloaded and installed Django 1.3, I can't seem to run the
console or server with this error:

AttributeError: 'NoneType' object has no attribute '_inf


$ python manage.py shell
Traceback (most recent call last):
  File "manage.py", line 13, in 
execute_manager(settings)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/
__init__.py", line 438, in execute_manager
utility.execute()
  File "/usr/local/lib/python2.7/site-packages/django/core/management/
__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/
base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/
base.py", line 209, in execute
translation.activate('en-us')
  File "/usr/local/lib/python2.7/site-packages/django/utils/
translation/__init__.py", line 100, in activate
return _trans.activate(language)
  File "/usr/local/lib/python2.7/site-packages/django/utils/
translation/trans_real.py", line 202, in activate
_active.value = translation(language)
  File "/usr/local/lib/python2.7/site-packages/django/utils/
translation/trans_real.py", line 186, in translation
current_translation = _fetch(language,
fallback=default_translation)
  File "/usr/local/lib/python2.7/site-packages/django/utils/
translation/trans_real.py", line 149, in _fetch
res._info = res._info.copy()
AttributeError: 'NoneType' object has no attribute '_info'

-- 
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: Unexpected error

2011-04-27 Thread Shawn Milochik
If you know how to cause this error, run manage.py shell and import or 
instantiate whatever you have to in order to make this happen.


The traceback you get there will be more useful.

Shawn

--
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: sqlite3 and south data migration

2011-04-27 Thread Shawn Milochik

On 04/27/2011 05:22 AM, Amit Sethi wrote:

Hi all does sqlite3  not support data migration. I am trying to
implement migration on my test fixtures using
south however i get this particular error :

AttributeError: 'DatabaseFeatures' object has no attribute
'supports_tablespaces'



Not all features are supported by sqlite3. I've also found that it 
doesn't properly enforce Django's 'unique_together' constraint. Also, it 
doesn't allow fields to be deleted.


If you're having these problems and you're going to be deploying with a 
different database anyway then it's easier to just use that database in 
development.



--
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: Error performing rar file download.

2011-04-27 Thread Cal Leeming [Simplicity Media Ltd]
... dare I ask, how big is the file?

Cal

On Wed, Apr 27, 2011 at 3:20 PM, Elton Pereira  wrote:

> When attempting to download a zip file the following error is raised:
>
> 192.168.1.39 - - [27/Apr/2011 11:12:35] "GET /media/downloads/betha/
> essencial/sybase9/windows32/win32.rar HTTP/1.1" 500 -
> Traceback (most recent call last):
>  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/
> basehttp.py", line 674, in __call__
>return self.application(environ, start_response)
>  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> wsgi.py", line 252, in __call__
>response = middleware_method(request, response)
>  File "/usr/local/lib/python2.6/dist-packages/django/middleware/
> gzip.py", line 35, in process_response
>response.content = compress_string(response.content)
>  File "/usr/local/lib/python2.6/dist-packages/django/utils/text.py",
> line 183, in compress_string
>zfile.write(s)
>  File "/usr/lib/python2.6/gzip.py", line 197, in write
>self.fileobj.write( self.compress.compress(data) )
> MemoryError
>
> NOTE: any other file I can download normally, the error only happens
> with RAR files.
>
> --
> 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: Double security login system

2011-04-27 Thread Cal Leeming [Simplicity Media Ltd]
To be honest, this really isn't a complex system, you shouldn't need
"interesting modules", maybe other than the pybulksms :S



On Wed, Apr 27, 2011 at 3:28 PM, mendes.rich...@gmail.com <
mendes...@gmail.com> wrote:

> Dear Django developers,
>
> Recently we've been asked to start a medical project with the highest
> security level system and login wise.
> This means we have to work with a double login system either managed
> via cisco tokens or sms codes send
> to the owners phone.
>
> After some searching around i found the django sms module which can be
> used, but am wondering if someone else
> has experienced some projects like this and can give me some pointers
> in set-up, possible interesting modules and
> pitfalls to look out for.
>
> any help would be greatly appreciated,
>
> best regards,
>
> Richard Mendes
>
> --
> 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.



Error performing rar file download.

2011-04-27 Thread Elton Pereira
When attempting to download a zip file the following error is raised:

192.168.1.39 - - [27/Apr/2011 11:12:35] "GET /media/downloads/betha/
essencial/sybase9/windows32/win32.rar HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/
basehttp.py", line 674, in __call__
return self.application(environ, start_response)
  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
wsgi.py", line 252, in __call__
response = middleware_method(request, response)
  File "/usr/local/lib/python2.6/dist-packages/django/middleware/
gzip.py", line 35, in process_response
response.content = compress_string(response.content)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/text.py",
line 183, in compress_string
zfile.write(s)
  File "/usr/lib/python2.6/gzip.py", line 197, in write
self.fileobj.write( self.compress.compress(data) )
MemoryError

NOTE: any other file I can download normally, the error only happens
with RAR files.

-- 
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.



Double security login system

2011-04-27 Thread mendes.rich...@gmail.com
Dear Django developers,

Recently we've been asked to start a medical project with the highest
security level system and login wise.
This means we have to work with a double login system either managed
via cisco tokens or sms codes send
to the owners phone.

After some searching around i found the django sms module which can be
used, but am wondering if someone else
has experienced some projects like this and can give me some pointers
in set-up, possible interesting modules and
pitfalls to look out for.

any help would be greatly appreciated,

best regards,

Richard Mendes

-- 
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: How i connect my PostgreeSQL to a Django?

2011-04-27 Thread Web Lucas
well,

I unnistall the PostgreeSQL and install MySQL

you can help me with the configuration ?

Thanks

On 26 abr, 15:40, Shawn Milochik  wrote:
> What error are you getting?

-- 
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: Can any one help me with this error "Page not found (404)" ?

2011-04-27 Thread Oleg Lomaka
Go on read 3rd part of tutorial about urls.py configuration
http://docs.djangoproject.com/en/dev/intro/tutorial03/


On Wed, Apr 27, 2011 at 8:13 AM, Maaz Muqri  wrote:

> Page not found (404)
> Request Method: GET
> Request URL:http://127.0.0.1:8000/
> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
> ^admin/
> The current URL, , didn't match any of these.
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a
> standard 404 page.
>
>
> 
>
>
> Iam getting this error when I am running the first Django Polls
> Application. Can anyone say me where is this Django settings file ? I
> am using Ubuntu operating system
>
>

-- 
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 composition in Django

2011-04-27 Thread Tom Evans
On Sun, Apr 17, 2011 at 9:21 PM, W Craig Trader  wrote:
> If your goal is to have an employee object that has direct access to all of
> its related person object, and whose only new data field is a reference to
> an address object, then you should change the Employee model to this:
>
> class Address(models.Model):
>    pass
>
> class Person(models.Model):
>    name = models.CharField(max_length=50)
>    date_inclusion = models.DateField()
>
> class Employee(models.Model):
>    person = models.OneToOneField(Person)
>    address = models.ForeignKey(Address)
>

Just to point out, this is MTI reinvented, without any of the Django
syntactic magic sprinkled on top. It is exactly equivalent to this:

class Address(models.Model):
   pass

class Person(models.Model):
   name = models.CharField(max_length=50)
   date_inclusion = models.DateField()

class Employee(Person):
   address = models.ForeignKey(Address)

"""
The second type of model inheritance supported by Django is when each
model in the hierarchy is a model all by itself. Each model
corresponds to its own database table and can be queried and created
individually. The inheritance relationship introduces links between
the child model and each of its parents (via an automatically-created
OneToOneField).
"""

http://docs.djangoproject.com/en/1.3/topics/db/models/#multi-table-inheritance

Cheers

Tom

-- 
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.



How can I force a browser to cache my view?

2011-04-27 Thread Oliver Andrich
Hi,

I have a problem getting the browser to cache the data returned by my view.
The basic idea behind this is, I want to download the data via ajax to
provide a progress dialog and afterwards I set document.location.href to the
same url and use the cached data. last_modified sets the last modified
header as expected. The creation also behaves like expected. The line
"document.location.href = href + '?timestamp=' + timestamp" creates a second
GET for my view, but I get a 200 http code instead of a 304. And if I look
at my browser cache contents, I can see, that my data is not cashed at call.
The caching even doesn't if I open the url in the browser directly.

Can I force the browser to cache my data?

Best regards,
Oliver

My Django view:

@login_required
@redweb_view
@last_modified(last_modified_func)
def show_pdf(request, page_id, quality):
page = Page.objects.get(pk=page_id)
with create_client_from_request(request).create_session() as s:
pdf_data = s.print_element(page_id, image_quality=quality)
response = HttpResponse(mimetype='application/pdf')
response['Content-Disposition'] = 'attachment; filename=%s.pdf' %
page.name
response.write(pdf_data)
return response

My Javascript code:

var timestamp = new Date().getTime();
$.get(href + '?timestamp=' + timestamp).success(function() {
document.location.href = href + '?timestamp=' + timestamp;
});

-- 
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.



Can any one help me with this error "Page not found (404)" ?

2011-04-27 Thread Maaz Muqri
Page not found (404)
Request Method: GET
Request URL:http://127.0.0.1:8000/
Using the URLconf defined in mysite.urls, Django tried these URL
patterns, in this order:
^admin/
The current URL, , didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django
settings file. Change that to False, and Django will display a
standard 404 page.




Iam getting this error when I am running the first Django Polls
Application. Can anyone say me where is this Django settings file ? I
am using Ubuntu operating system

-- 
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.



Using User.add_to_class

2011-04-27 Thread Venkatraman S
Hi,

In my app, i have many functions added to the User class using
User.add_to_class ; these are basically the functions that restrict the
objects that can be viewed by the user during his session with the app. The
functions are present in __init__.py in my project.

My Q : is this a good paradigm to do things? i.e, restricting the user's
workspace. Or is it better that i do the DB queries in my views - apply
filter on the queries there.
Which is a better model and would scale?(and also be easier if i implement
caching in the near future).

IMHO, i find User.add_to_class to be extremely useful and the code is much
easier to maintain; but since this is a paradigm Q, i would let the more
experienced answer this.

-Venkat
http://blizzardzblogs.blogspot.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: How to display the data on the page from the database

2011-04-27 Thread Kenneth Gonsalves
On Wed, 2011-04-27 at 03:11 -0700, Daniel Roseman wrote:
> On Wednesday, April 27, 2011 7:38:32 AM UTC+1, GKR wrote:
> >
> > How to display the data on the page from the database in tabular
> format 
> > like msflexgrid with update facility.
> >
> >
> > Please help
> >
> 
> First, you write some back-end code. Then, you write some front-end
> code. 

no middleware?
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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: How to display the data on the page from the database

2011-04-27 Thread Daniel Roseman
On Wednesday, April 27, 2011 7:38:32 AM UTC+1, GKR wrote:
>
> How to display the data on the page from the database in tabular format 
> like msflexgrid with update facility.
>
>
> Please help
>

First, you write some back-end code. Then, you write some front-end code.

Hope that helps.
--
DR. 

-- 
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.



sqlite3 and south data migration

2011-04-27 Thread Amit Sethi
Hi all does sqlite3  not support data migration. I am trying to
implement migration on my test fixtures using
south however i get this particular error :

AttributeError: 'DatabaseFeatures' object has no attribute
'supports_tablespaces'

-- 
A-M-I-T S|S

-- 
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.



Javascript frameworks with Django

2011-04-27 Thread Jani Tiainen
Hi,

I've been for a while been using ExtJS and Dojotoolkit. Specially very 
recently released ExtJS 4 brought lot of interesting features including 
loading on demand (Dojotoolkit had it for a good while).

Now I'm facing good practice problem:

I want to construct apps that relies pretty much solely on "web 2.0" 
technologies, namely to rewrite desktop apps in a web.

There comes the "problem". To make things work smooth browser side javascript 
code needs to talk to Django views and to make that happen I need to get URLs 
working (and later on translations).

How to make all that work together well? I mean where to put dynamic parts, 
where to put static parts and at some day - translations.

Should I mix and match templates and plain static javascripts? One problem 
that I've been facing (though 1.3 probably fixed it) was resources from 
different apps, specially static js parts.

-- 

Jani Tiainen

-- 
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: Hyperlinks in Messages

2011-04-27 Thread Oleg Lomaka
Just use appropriate filter for your raw message.

For example to make all urls clickable in you message, you can apply
urlizefilter


{% for message in messages %}
{{ message*|urlize* }}
{% endfor %}



Or use safe
to
render raw html in your messages.

On Wed, Apr 27, 2011 at 8:29 AM, Venkatraman S  wrote:

> Hi,
>
> How can i include hyperlinks in the messages?(am using the messages
> framework).
> The hyperlinks dont seem to get rendered; am getting the text'd version of
> the HTML.
>
> -Venkat
>
> --
> 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: Experience of migrating a Django site to DotCloud

2011-04-27 Thread Olli Wang
I had tried WebFaction before, but its SSH shell is extremely slow in
my country.

The first plan (40USD) should allow 3 instances, which means I can
assign one for Django site, one for database, and one for a worker to
handle time-consuming work. I don't know whether WebFaction is
designed for scaling or not, but I believe DotCloud is once it is out
of beta. Especially the beta is free, nothing gonna lose to give it a
try, right?

On Apr 27, 1:31 pm, Venkatraman S  wrote:
> On Wed, Apr 27, 2011 at 10:34 AM, Olli Wang  wrote:
> > I have migrated my Django site to the new PaaS provider DotCloud. I
> > think it's a pretty good choice if you want to deploy your Django on
> > the cloud.
>
> > You can see the full article at
> >http://www.ollix.com/blog/2011/04/25/migrating-django-site-dotcloud/
>
> 40USD per month! hmmm..how are they better then webfaction? (and also
> considering that they are in beta).

-- 
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.



How to display the data on the page from the database

2011-04-27 Thread GKR
How to display the data on the page from the database in tabular format like 
msflexgrid with update facility.


Please help

-- 
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.