Re: unit testing and not creating database for read only database

2010-07-29 Thread thusjanthan
Any suggestions? On Jul 7, 2:21 pm, thusjanthan <thusjant...@gmail.com> wrote: > Hi, > > So I have a read only database called "information" which has been > modeled in the django framework with the managed=false for the META on > all its tables. When I run unit tes

When doing select_related, the sql query produced is an INNER JOIN can that be changed to LEFT JOIN

2010-07-29 Thread thusjanthan
, the person is returned with email set to null. Cheers, Thusjanthan. -- 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

Re: Anyone want to take over maintaining Instant Django?

2010-07-13 Thread thusjanthan
rather fast. Cheers, Thusjanthan. On Jul 13, 7:37 am, cjl <cjl...@gmail.com> wrote: > Djangoholics: > > I no longer have the time or interest to maintain my little project: > > http://www.instantdjango.com > > If anyone would like to take over the project, I would gladl

Re: reportlab pdf creation: HTML textarea input formatting doesn't seem to work with Paragraph

2010-07-08 Thread thusjanthan
; return result Thusjanthan On Jul 8, 11:53 am, thusjanthan <thusjant...@gmail.com> wrote: > Hi, > > I have a user that enters some formatted text in a html textarea. I > would like to use reportlab to display that and other fields in a PDF. > However when I wr

reportlab pdf creation: HTML textarea input formatting doesn't seem to work with Paragraph

2010-07-08 Thread thusjanthan
Hi, I have a user that enters some formatted text in a html textarea. I would like to use reportlab to display that and other fields in a PDF. However when I wrap the text in a Paragraph type it alters the formatting. Can anyone suggest how to keep the formatting that the user enters into the

unit testing and not creating database for read only database

2010-07-07 Thread thusjanthan
ut would rather like to use the information's table's values to compute some other tests for this app. Is there any way to do that in django? Thusjanthan. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Is {% cycle ... as ... %} supposed to output a value?

2010-07-07 Thread thusjanthan
This is the desired behavior. Until the loop is done it cycles the given values you provided in your case 'a' 'b' and since the loop is running 3 times it cycles back to 'a' again. Cheers, Thusjanthan On Jul 7, 8:55 am, ringemup <ringe...@gmail.com> wrote: > Er, that was sloppy of me

Re: Override Django ORM with virtual model class - is it possible or no?

2010-07-06 Thread thusjanthan
field types but it can only be types from a database. Don't quote me on that but I think so. Have a look at this where they go further into custom model fields. http://docs.djangoproject.com/en/dev/howto/custom-model-fields/#custom-database-types Hope this helps, Thusjanthan Kubendranathan

Re: How to record/capture IP address of user/registrant in Django

2010-07-06 Thread thusjanthan
it as follows: : request.META['REMOTE_ADDR'] More information on the META dict can be found at: http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.META Cheers, Thusjanthan Kubendranathan On Jul 6, 2:16 pm, NoviceSortOf <dljonsson2...@gmail.com> wrote: >

Re: HTML Frames and Django Template include

2010-07-06 Thread thusjanthan
nt of what you'd like on the right hand side using context etc... {% endblock %} Now when you go to the test view you'll see the page wrapped by your base.html with the content block in the right frame if you did it correctly :) Cheers, Thusjanthan K On Jul 6, 2:12 pm, NoviceSortOf &

Re: DATABASE_ROUTERS in settings.py results in Internal Server Error

2010-06-30 Thread thusjanthan
Hi, If your project is named myproject and your app is named myapp where the router is contained. Then you need to set it to the following and you need to include the Classname as well. So if your AppRouter is like this which is in the directory myproject.myapp: AppRouter.py: Class

does QuerySet delete delete the objects by their primary key?

2010-06-30 Thread thusjanthan
Hi, I did a query on an object using their "non" primary keys such that: a = Topic.objects.filter(topic='Politics') topic is not a primary key. suppose topicID is primary key. When I run: a.delete() the SQL that is executed is: DELETE FROM 'Topic' WHERE topicID in (1) my problem is a

Re: More than one primary key for a model

2010-06-28 Thread thusjanthan
primary keys. > Depending on the database backend you're using, the unique_together > Meta attribute may accomplish most of what you're looking to do. > > On Jun 28, 12:49 pm, thusjanthan <thusjant...@gmail.com> wrote: > > > > > Can anyone tell me why django refuse

More than one primary key for a model

2010-06-28 Thread thusjanthan
Can anyone tell me why django refuses to follow the rules and lesson we learn in our database courses? I have a table that I do not have control over. Suppose its called the phone table and it contains the number and the username as the primary key. But for some reason when I have more than one

Creating and binding more than one model to a from

2010-06-28 Thread thusjanthan
Hi, I have a Topic class I would like to create a form based on. BUT, I want many of these objects so Topics. How do I obtain such a feature. Suppose my form object is as follows: class TopicForms(ModelForm): class meta: model = Topic fields = ('topic_id','topic') I want to

manytomany relationships based on primary keys

2010-06-25 Thread thusjanthan
I have the following relationship between student and course: class Student(models.Model): crse_id = models.CharField(max_length=18,primary_key=True) crse_offer_nbr = models.IntegerField(primary_key=True) strm = models.CharField(max_length=12,primary_key=True) class_section =

Re: django csrf

2010-06-25 Thread thusjanthan
The quick answer is you have to put the following in your template right after the declaration: {% csrf_token %} Cheers, Nathan. On Jun 25, 2:48 am, Li Hui wrote: > When I add enctype="text/plain" to a post form like method="post" enctype="text/plain">, there is a "CSRF

Re: How to do select from table where something in ('What','When','Where')

2010-06-24 Thread thusjanthan
nvm found it :) just append it to the .exclude method right? On Jun 24, 1:40 pm, thusjanthan <thusjant...@gmail.com> wrote: > Hi, > > How about not in? > > Select * from tableA where columnA not in > ('Value1','Value2','Value3') > > On Jun 24, 1:23 pm, Peter Hernd

Re: How to do select from table where something in ('What','When','Where')

2010-06-24 Thread thusjanthan
odels/querysets/#in > > On Jun 24, 2010, at 4:18 PM, thusjanthan wrote: > > > > > Hi, > > > Can someone provide the syntax for doing the following in django > > queries: > > > Select * from tableA where columnA in ('Value1','Value2','Value3') > > > C

How to do select from table where something in ('What','When','Where')

2010-06-24 Thread thusjanthan
Hi, Can someone provide the syntax for doing the following in django queries: Select * from tableA where columnA in ('Value1','Value2','Value3') Cheers, nathan. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Would like to modify request.user and have it be the changed value through out site

2010-06-23 Thread thusjanthan
Hi, Basically within my application for whatever reason I am changing the user and doing something like this: Ex: at first the request.user = UserA request.user = Users.objects.get(some exp) After this the request.user = UserB However once the page redirects to another page the request.user

from a template how to access the request object

2010-06-23 Thread thusjanthan
Hi all. >From a template suppose base.html in your templates how do I access the request object without actually passing it via the view. Cause I can access the user object using {{ user }} but I can't access the get_full_path using something like {{ request.get_full_path }} Any thoughts?

Django logging

2010-06-23 Thread thusjanthan
Hi, I am creating a new django framework and figured django would come with its own logging feature. I found this one that Fraser wrote but is no longer in development (http://code.google.com/p/django-logging/ wiki/Overview) Can anyone suggest me a django logging project to log debug/error

Re: How to create the model in a different database from within the same database server.

2010-06-16 Thread thusjanthan
com> wrote: > Which version of django are you working with? > > On Jun 16, 2:28 pm, thusjanthan <thusjant...@gmail.com> wrote: > > > > > Hi, > > > when I mean database I mean the separate databases from within one > > mysql database server. So ex