Saturday, March 31, 2012

Re: django-admin change form page validation

On Sat, 2012-03-31 at 09:25 +0530, Nikhil Verma wrote:
> How can i do this kind validation where fields are dependent on each
> other

https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#adding-custom-validation-to-the-admin

docs are wonderful
--
regards
Kenneth Gonsalves


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Filtering results before & after update?

I have a straightforward form that simply reduces an item count by 1, for a selected product. (The form essentially "ships" a product, so need to decrease remaining term_length by 1).

I have the following code:

            cd = form.cleaned_data

            q = Subscription.objects.filter(product_key__exact = cd['product'])
            q = q.filter(status__iexact='Active')
            q = q.filter(term_length__gt=0)
            
            # Decrement our terms remaining by 1.
            rec_count = q.update(term_length=F('term_length') - 1)

            return render_to_response('subs/shipped.html',{ 'q': q, 'rec_count': rec_count })

What happens is that the results I want to display on the "shipped" page are still being filtered according to the criteria I used to select the rows for updating. Since I have a >= 0 filter, I do not see those rows that were reduced from 1 to 0. I can't use {{ q|length }} to get number of records updated, for example.

How would I go about returning, for example, a list of the freshly updated records from BEFORE they were updated. I can't search after the fact, since status and term_length would be Inactive and 0 for a huge number of records; there will be nothing distinct about the ones that were last changed.

Thanks for the help.

M.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/sxHCRgN2EGYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

getting POST 500 (OK), when using $.ajax on that url

I trying to use jquery ajax to send json data to django

sorry if providing javascript code but it may help solving my problem
____________________
$("#send").click(function() {
events = $('#calendar').fullCalendar('clientEvents');
  console.log(events);
  var filter = new Array();
  filter[0] = 'start';
  filter[1] = 'end';
  filter[2] = 'title';
  events = JSON.stringify(events, filter, '\t');
  console.log(events);
  $.ajax({
  type: "POST",
  data: "events",
  url: <my_url>,
  });
});
_____________________

on chrome devtool every thing is ok until the last $.ajax()

it throw this error

  1. POST <my_url> 500 (OK)
    1. f.support.ajax.f.ajaxTransport.sendjquery-1.7.1.min.js:4
    2. (anonymous function)<my_url>
    3. f.event.dispatchjquery-1.7.1.min.js:3
    4. f.event.add.h.handle.i


so why am I getting 500 error, event I tried to use csrf_exempt or disabling the csrf entirely but nothing changed

If any one can figure out what I'm doing wrong please go ahead 

thanks in advance

Ahmad



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Rrnj8xOwNqIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: I don't get what Poll.objects.get(pk=1) does

hello, thanks.

I wonder if it was caused by this error: ValueError: unknown locale: UTF-8 . It shows up but if I run the code again, it disappears..Otherwise, I have not made any mistakes and followed the tutorials ..

-Kisun
On Mar 31, 2012, at 11:38 PM, Sergiy Khohlov wrote:

> look like all is correct.
> it will be nice to separate a working with database and python
> object. Using pk=1 you will get object with primary key equal 1.
> Also yo will try to worki wit object as with list...
>
> thanks,
> serge
>
> 2012/3/31 excalibur1491 <excalibur1491@gmail.com>:
>> Hi,
>>
>> I'm learning Django (I already know Python) and I'm following the
>> tutorial: https://docs.djangoproject.com/en/1.3/intro/tutorial01/
>> At the end of the tutorial there is a code where the programmer does:
>> p = Poll.objects.get(pk=1) .
>> I want to be sure if I understand it well.
>> Poll.object.get(pk=1) is returning the poll which primary key is 1 in
>> the DB, isn't it?
>> This is stored in p, which is actually the poll which pk is 1, so it's
>> itselft but with new class variables added (the other side of the
>> Foreign Keys). Is it correct?
>> This creates a new class variable called choice_set because Choise is
>> an other-side foreign key of poll.
>> This object (choise_set, of type RelatedManager) has a method create
>> that adds things to the set.
>>
>>
>> Did I understand it well??
>>
>> Thank you,
>>
>> (PS: sorry for my english )
>>
>> --
>> 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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: TemplateDoesnotExist: 500.html

On Sat, Mar 31, 2012 at 5:03 PM, Pals <pokharel.kisun@gmail.com> wrote:
>  I am a novice programmer who just started to learn Django.. I could
> not figure out the error related to 500.html. In fact, I would be
> grateful if someone guides me making 500.html file. I am using mac
> osx, Python 2.7 and Django 1.4.
>

https://docs.djangoproject.com/en/dev/topics/http/views/#the-500-server-error-view

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: I don't get what Poll.objects.get(pk=1) does

look like all is correct.
it will be nice to separate a working with database and python
object. Using pk=1 you will get object with primary key equal 1.
Also yo will try to worki wit object as with list...

thanks,
serge

2012/3/31 excalibur1491 <excalibur1491@gmail.com>:
> Hi,
>
> I'm learning Django (I already know Python) and I'm following the
> tutorial: https://docs.djangoproject.com/en/1.3/intro/tutorial01/
> At the end of the tutorial there is a code where the programmer does:
> p = Poll.objects.get(pk=1) .
> I want to be sure if I understand it well.
> Poll.object.get(pk=1) is returning the poll which primary key is 1 in
> the DB, isn't it?
> This is stored in p, which is actually the poll which pk is 1, so it's
> itselft but with new class variables added (the other side of the
> Foreign Keys). Is it correct?
> This creates a new class variable called choice_set because Choise is
> an other-side foreign key of poll.
> This object (choise_set, of type RelatedManager) has a method create
> that adds things to the set.
>
>
> Did I understand it well??
>
> Thank you,
>
> (PS: sorry for my english )
>
> --
> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

TemplateDoesnotExist: 500.html

I am a novice programmer who just started to learn Django.. I could
not figure out the error related to 500.html. In fact, I would be
grateful if someone guides me making 500.html file. I am using mac
osx, Python 2.7 and Django 1.4.

Thanks!

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: integer array in django models

On Sat, 31 Mar 2012 18:27:56 +0530, dummyman dummyman
<tempovan@gmail.com> declaimed the following in
gmane.comp.python.django.user:

> Which model field in django is used to represent an integer array in mysql ?

To my knowledge: NONE

So far as I recall, MySQL does not have an extended data type
"array". Neither do most normal relational database engines (the only
one I know that does have an array type is PostgreSQL, and that probably
goes back to the preSQL PostGres days).

Representation of an array is done by normalizing the data. Instead
of one table (relation)
ID, someDiscrete, {an, array, of, values}
you create two tables by normalization
ID, someDiscrete
and
ID, foreignID, optionalIndex, value
ie:
x, someDiscrete
and
m, x, 1, an
m+1, x, 2, array
m+3, x, 3, of
m+4, x, 4, values
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: modifying generated create table scripts and ise sync db?

Hello Kasun,

I hope the following link helps.
https://docs.djangoproject.com/en/1.4/ref/models/fields/#primary-key

Thanks.

2012/3/31 KasunLak <kasun.lakpriya86@gmail.com>
This is a oracle create table statements for what I wanted to do in
django. How to get a relationship like this in django model. Is there
a way to manually modify the generated create table statements in
django to fulfil our needs. eg: removing id column, make one column a
primary key of another like below. Thank you. Though the following are
from Oracle I want to do it in mysql. this is just to show what I want
to get.

CREATE TABLE user_tab
     ( mobileno                        VARCHAR2       NOT NULL,
       name_                          VARCHAR2       NOT NULL,
       town_                          VARCHAR2       NOT NULL,
       contact_no                     VARCHAR2       NOT NULL)
TABLESPACE &pola_data
STORAGE (&normal)
/


ALTER TABLE user_tab
  ADD ( CONSTRAINT user_pk PRIMARY KEY (mobileno)
        USING INDEX
              TABLESPACE &pola_index
              STORAGE (&normal))
/

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Report generation-reportlab

On Sat, Mar 31, 2012 at 7:54 AM, Marc Aymerich <glicerinu@gmail.com> wrote:
> On Sat, Mar 31, 2012 at 12:38 PM, Ganesh Kumar <bugcy013@gmail.com> wrote:
>> Hi guys,
>>
>> I am new to django reportlab. I want to generate pdf. file to select
>> mysql (table) content. How to proceed with reportlab, I can do with
>> some other tool.
>> please guide me. your valuable suggestion.
>>
>
> I'll use pisa, it allows you to generate pdf's from html source. So
> it's perfect for Django: write a template with html format, render the
> template and pass it to pisa.
>
> this snipet will show you how to do all the process:
> http://djangosnippets.org/snippets/659/

AFAIK pisa has been deprecated in favour of xhtml2pdf[0]. You can use
this[1] mixin in your CBV to deliver PDFs instead of regular html.

Regards,
Ivan

[0] http://www.xhtml2pdf.com/
[1] https://github.com/rasca/django-enhanced-cbv/blob/master/enhanced_cbv/views/base.py#L4

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

django forms in admin

Hi , 

I ve a set of fields which is displayed in admin using fieldsets in django. But i want to modify the display of only one field. ie i used CommaSeparatedField , i want that 2 display in forms.MultipleChoiceField . How do i achieve it ? 

i did like this

class A(forms.ModelForm):
    fielda = forms.MultipleChoiceField....
    
    class Meta:
     model=A



then in admin.py


class Some(admin,ModelAdmin):

form=A


#fielsets


fieldsets = [ 

...

]


but im getting errors coz all the fields need to be displayed in forms .

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: canceling account

Lilian,

To be clear here, Django is a web framework for creating web applications. Then there are web hosting services out there that will let you run your Django applications on their servers. Within your own Django application, you may have administrative accounts setup.

What account (and where) is it that you need removed, exactly?

--
Joey Espinosa
Software Engineer
http://about.me/joelinux

On Mar 31, 2012 9:44 AM, "Sergiy Khohlov" <skhohlov@gmail.com> wrote:
Hello,
 What do you  mean ?
Each  django application has  ability to add  django superuser account.
Also hoster company provide a  account  for setting django application
 at the host.
Please clarify  what do you want to do

 Thanks,
Serge

2012/3/31 Lillian Cauldwell <lillian.cauldwell@gmail.com>:
>
> My previous webmaster set up my company's d'jango account.
> He no longer works for me.
> How do I cancel my account?
>
> Thanks,
> Lillian
> --
> "Creator" Cauldwell
> CEO, Passionate World Radio, Inc.
> Distinguish Yourself From the Ordinary! (c) 2010-2011 PWR
> http://www.internetvoicesradio.com
> http://www.amazingworldsoflscauldwell.com
> http://pwrwebtv.intuitwebsites.com
> 734-827-9407
>
> --
> 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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: canceling account

Hello,
What do you mean ?
Each django application has ability to add django superuser account.
Also hoster company provide a account for setting django application
at the host.
Please clarify what do you want to do

Thanks,
Serge

2012/3/31 Lillian Cauldwell <lillian.cauldwell@gmail.com>:
>
> My previous webmaster set up my company's d'jango account.
> He no longer works for me.
> How do I cancel my account?
>
> Thanks,
> Lillian
> --
> "Creator" Cauldwell
> CEO, Passionate World Radio, Inc.
> Distinguish Yourself From the Ordinary! (c) 2010-2011 PWR
> http://www.internetvoicesradio.com
> http://www.amazingworldsoflscauldwell.com
> http://pwrwebtv.intuitwebsites.com
> 734-827-9407
>
> --
> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

canceling account


My previous webmaster set up my company's d'jango account.
He no longer works for me.
How do I cancel my account?
 
Thanks,
Lillian
--
"Creator" Cauldwell
CEO, Passionate World Radio, Inc.
Distinguish Yourself From the Ordinary! (c) 2010-2011 PWR
734-827-9407

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

integer array in django models

Which model field in django is used to represent an integer array in mysql ?

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: django-admin change form page validation

Hi

I did not override response_change method but i override clean method by creating form in admin like this :-

class InterviewAdminForm(forms.ModelForm):
    class Meta:
        model = Interview
   
    def clean(self, *args, **kwargs):
        cleaned_data = super(InterviewAdminForm, self).clean(*args, **kwargs)
       
        if self.cleaned_data['interview_type'] == "default" \
        and self.cleaned_data['Revisit'] == True:
            raise forms.ValidationError({'interview_type': ["error message",]})
        else:
            return cleaned_data

It displays the ValidationError message on the admin page but somehow i want show that error just above the interview_type field .
How can i achieve this ?

This method  works pretty fine. I want to know when we use response_change method ?


Thanks in advance .
On Sat, Mar 31, 2012 at 10:50 AM, dummyman dummyman <tempovan@gmail.com> wrote:
ok. in admin,.py file


override the response_change method

def response_change(self,request,obj)

obj is the handler

so u can check using obj.field_name and take approp action


On Sat, Mar 31, 2012 at 10:34 AM, Nikhil Verma <varma.nikhil22@gmail.com> wrote:
Hi

I understand that but the problem is its a condition which i have to add if the revisit checkbox is selected and then in interview_type dropdown None option is selected ; after pressing save it should throw an error .

None is an option in the dropdown . It is not blank=True and null =True

INTERVIEW_TYPES = (
       
        ('default', 'None'),
        ('Paired Visit','Paired Visit'),
        ('Time Series', 'Time Series'),
        
    ),

interview_type will show choices with dropdown 1) None 2) Paired Visit 3) Time Series


On Sat, Mar 31, 2012 at 10:28 AM, dummyman dummyman <tempovan@gmail.com> wrote:
Hi

unless u dont specify blank=True or null = True in modes for d corresponding fields, django will throw an errror if u don fill up the field

On Sat, Mar 31, 2012 at 9:25 AM, Nikhil Verma <varma.nikhil22@gmail.com> wrote:
Hi All

How can i apply validation in admin on various fields when they are dependent on each other ?

e.g. Let say in i have a  Field A(BooleanField)  and Field B (CharField) what i want to do is if in admin user select the Field A(checkbox) and does not enter anything in Field B
and if he tries to save ,it should throw an error like a normal blank=False gives. So how can i do this kind of validation in admin .

E.g  Use Case

I have a table having the following structure :-

INTERVIEW_TYPES = (
       
        ('default', 'None'),
        ('Paired Visit','Paired Visit'),
        ('Time Series', 'Time Series'),
        
    ),

class Interview(models.Model):
    ic_number              = models.CharField(verbose_name ="Visit Configuration Number",max_length=20,unique=True,null =True,blank=True)
    ic_description         = models.TextField(verbose_name ="Visit Configuration Description",null = True,blank=True)
    title                  = models.CharField(verbose_name ="Visit Configuration Title",max_length=80,unique=True)
    starting_section       = models.ForeignKey(Section)
    interview_type         = models.CharField(verbose_name = "Mapped Visit",choices=CHOICES.INTERVIEW_TYPES, max_length=80, default="Time Series")
    select_rating          = models.CharField(choices=CHOICES.QUESTION_RATING, max_length=80, default="Select Rating")
    view_notes             = models.CharField(choices=CHOICES.VIEW_NOTES, max_length=80, default="Display Notes")
     revisit                = models.BooleanField(default=False)   
.....and so on ......
  
    class Meta:
        verbose_name = 'Visit Configuration'
        verbose_name_plural = 'Visit Configurations'
       # ordering = ('rpn_number',)
   
    def __unicode__(self):
        return self.title

Its admin.py

class InterviewAdmin(admin.ModelAdmin):
    list_display = ('id','title', 'starting_section','ic_number','show_prior_responses')
    raw_id_fields = ('starting_section',)
admin.site.register(Interview, InterviewAdmin)

In admin , If i select the checkbox of revisit and in the field interview_type(which will show a dropdown having choices None,Paired Visit , Time Series) if a User has selected None from that dropdown and then press save button it should throw me an error like a normal blank=False shows, saying "This field is required"

How can i do this kind validation where fields are dependent on each other ? 

Please Ignore syntax error is any .

Thanks


--
Regards
Nikhil Verma
+91-958-273-3156

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Regards
Nikhil Verma
+91-958-273-3156

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Regards
Nikhil Verma
+91-958-273-3156

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Django inline display

Is it possible to change the display of inlines in order to change it from this



to something like this?

Basically I need to display all the options available from the Topic field (without the option to add more opinion) and display all the Score field options as radioboxes. Is it possible through templates or widget overriding?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/vBhZixStIk4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Report generation-reportlab

On Sat, Mar 31, 2012 at 12:38 PM, Ganesh Kumar <bugcy013@gmail.com> wrote:
> Hi guys,
>
> I am new to django reportlab. I want to generate pdf. file to select
> mysql (table) content. How to proceed with reportlab, I can do with
> some other tool.
> please guide me. your valuable suggestion.
>

I'll use pisa, it allows you to generate pdf's from html source. So
it's perfect for Django: write a template with html format, render the
template and pass it to pisa.

this snipet will show you how to do all the process:
http://djangosnippets.org/snippets/659/

--
Marc

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Report generation-reportlab

Hi guys,

I am new to django reportlab. I want to generate pdf. file to select
mysql (table) content. How to proceed with reportlab, I can do with
some other tool.
please guide me. your valuable suggestion.

-Ganesh.
Did I learn something today? If not, I wasted it.

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

I don't get what Poll.objects.get(pk=1) does

Hi,

I'm learning Django (I already know Python) and I'm following the
tutorial: https://docs.djangoproject.com/en/1.3/intro/tutorial01/
At the end of the tutorial there is a code where the programmer does:
p = Poll.objects.get(pk=1) .
I want to be sure if I understand it well.
Poll.object.get(pk=1) is returning the poll which primary key is 1 in
the DB, isn't it?
This is stored in p, which is actually the poll which pk is 1, so it's
itselft but with new class variables added (the other side of the
Foreign Keys). Is it correct?
This creates a new class variable called choice_set because Choise is
an other-side foreign key of poll.
This object (choise_set, of type RelatedManager) has a method create
that adds things to the set.


Did I understand it well??

Thank you,

(PS: sorry for my english )

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: How can I best create a blog that works similarly to Tumblr?

Thanks for the reply! I'll try that, I had asked the same question on IRC at #django and I got no real results. I'll try this and see how it works. :)
-Wellington "Willy" Cordeiro


On Fri, Mar 30, 2012 at 11:46 PM, Russell Keith-Magee <russell@keith-magee.com> wrote:

On 31/03/2012, at 4:01 AM, Willy wrote:

> I know the question is kind of poorly phrased. But here goes, I've been working on a blog software and I want to have five distinct post types (in the same way Tumblr does) but I'm having a hard time figuring out how to create my index view and detail views as they are currently five different models that inherit from the same abstract base model.
>
> Here is my models.py http://dpaste.com/724371/
> as well as my views.py http://dpaste.com/724372/
> and for safe measure, my urls.py within the app http://dpaste.com/724373/
>
> How can I make this work? The current hack of using chain() isn't really working out because of the fact that it returns a list, not a queryset.

It sounds like most of your problems originate from the fact that you're using an abstract base class for posts.

If you make BasePost non-abstract, then you'll be able to generate a queryset of BasePost objects, rather than having to chain through querysets of the concrete subclasses. Once you have a BasePost instance, you can retrieve the specific details associated with each instance with a single attribute request. It also means that when you start introducing links to posts, you won't need to maintain 5 different foreign key types (i.e., link to a text post, link to an image post, etc) -- there's just one "link to a post".

The detail view is also simplified -- it's a detail view for BasePost, not some hybrid that is trying to handle 5 different subclasses.

The only other thing you might want to change is to make post_type a field on BasePost; this isn't strictly required, but it will make it easier to do CORBA-style "narrowing" (i.e., I have a BasePost instance; what type of Post is it, and how do I get an object of that type?).

Hope this helps!

Yours,
Russ Magee %-)

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Friday, March 30, 2012

modifying generated create table scripts and ise sync db?

This is a oracle create table statements for what I wanted to do in
django. How to get a relationship like this in django model. Is there
a way to manually modify the generated create table statements in
django to fulfil our needs. eg: removing id column, make one column a
primary key of another like below. Thank you. Though the following are
from Oracle I want to do it in mysql. this is just to show what I want
to get.

CREATE TABLE user_tab
( mobileno VARCHAR2 NOT NULL,
name_ VARCHAR2 NOT NULL,
town_ VARCHAR2 NOT NULL,
contact_no VARCHAR2 NOT NULL)
TABLESPACE &pola_data
STORAGE (&normal)
/


ALTER TABLE user_tab
ADD ( CONSTRAINT user_pk PRIMARY KEY (mobileno)
USING INDEX
TABLESPACE &pola_index
STORAGE (&normal))
/

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: How can I best create a blog that works similarly to Tumblr?

On 31/03/2012, at 4:01 AM, Willy wrote:

> I know the question is kind of poorly phrased. But here goes, I've been working on a blog software and I want to have five distinct post types (in the same way Tumblr does) but I'm having a hard time figuring out how to create my index view and detail views as they are currently five different models that inherit from the same abstract base model.
>
> Here is my models.py http://dpaste.com/724371/
> as well as my views.py http://dpaste.com/724372/
> and for safe measure, my urls.py within the app http://dpaste.com/724373/
>
> How can I make this work? The current hack of using chain() isn't really working out because of the fact that it returns a list, not a queryset.

It sounds like most of your problems originate from the fact that you're using an abstract base class for posts.

If you make BasePost non-abstract, then you'll be able to generate a queryset of BasePost objects, rather than having to chain through querysets of the concrete subclasses. Once you have a BasePost instance, you can retrieve the specific details associated with each instance with a single attribute request. It also means that when you start introducing links to posts, you won't need to maintain 5 different foreign key types (i.e., link to a text post, link to an image post, etc) -- there's just one "link to a post".

The detail view is also simplified -- it's a detail view for BasePost, not some hybrid that is trying to handle 5 different subclasses.

The only other thing you might want to change is to make post_type a field on BasePost; this isn't strictly required, but it will make it easier to do CORBA-style "narrowing" (i.e., I have a BasePost instance; what type of Post is it, and how do I get an object of that type?).

Hope this helps!

Yours,
Russ Magee %-)

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: django-admin change form page validation

ok. in admin,.py file


override the response_change method

def response_change(self,request,obj)

obj is the handler

so u can check using obj.field_name and take approp action

On Sat, Mar 31, 2012 at 10:34 AM, Nikhil Verma <varma.nikhil22@gmail.com> wrote:
Hi

I understand that but the problem is its a condition which i have to add if the revisit checkbox is selected and then in interview_type dropdown None option is selected ; after pressing save it should throw an error .

None is an option in the dropdown . It is not blank=True and null =True

INTERVIEW_TYPES = (
       
        ('default', 'None'),
        ('Paired Visit','Paired Visit'),
        ('Time Series', 'Time Series'),
        
    ),

interview_type will show choices with dropdown 1) None 2) Paired Visit 3) Time Series


On Sat, Mar 31, 2012 at 10:28 AM, dummyman dummyman <tempovan@gmail.com> wrote:
Hi

unless u dont specify blank=True or null = True in modes for d corresponding fields, django will throw an errror if u don fill up the field

On Sat, Mar 31, 2012 at 9:25 AM, Nikhil Verma <varma.nikhil22@gmail.com> wrote:
Hi All

How can i apply validation in admin on various fields when they are dependent on each other ?

e.g. Let say in i have a  Field A(BooleanField)  and Field B (CharField) what i want to do is if in admin user select the Field A(checkbox) and does not enter anything in Field B
and if he tries to save ,it should throw an error like a normal blank=False gives. So how can i do this kind of validation in admin .

E.g  Use Case

I have a table having the following structure :-

INTERVIEW_TYPES = (
       
        ('default', 'None'),
        ('Paired Visit','Paired Visit'),
        ('Time Series', 'Time Series'),
        
    ),

class Interview(models.Model):
    ic_number              = models.CharField(verbose_name ="Visit Configuration Number",max_length=20,unique=True,null =True,blank=True)
    ic_description         = models.TextField(verbose_name ="Visit Configuration Description",null = True,blank=True)
    title                  = models.CharField(verbose_name ="Visit Configuration Title",max_length=80,unique=True)
    starting_section       = models.ForeignKey(Section)
    interview_type         = models.CharField(verbose_name = "Mapped Visit",choices=CHOICES.INTERVIEW_TYPES, max_length=80, default="Time Series")
    select_rating          = models.CharField(choices=CHOICES.QUESTION_RATING, max_length=80, default="Select Rating")
    view_notes             = models.CharField(choices=CHOICES.VIEW_NOTES, max_length=80, default="Display Notes")
     revisit                = models.BooleanField(default=False)   
.....and so on ......
  
    class Meta:
        verbose_name = 'Visit Configuration'
        verbose_name_plural = 'Visit Configurations'
       # ordering = ('rpn_number',)
   
    def __unicode__(self):
        return self.title

Its admin.py

class InterviewAdmin(admin.ModelAdmin):
    list_display = ('id','title', 'starting_section','ic_number','show_prior_responses')
    raw_id_fields = ('starting_section',)
admin.site.register(Interview, InterviewAdmin)

In admin , If i select the checkbox of revisit and in the field interview_type(which will show a dropdown having choices None,Paired Visit , Time Series) if a User has selected None from that dropdown and then press save button it should throw me an error like a normal blank=False shows, saying "This field is required"

How can i do this kind validation where fields are dependent on each other ? 

Please Ignore syntax error is any .

Thanks


--
Regards
Nikhil Verma
+91-958-273-3156

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Regards
Nikhil Verma
+91-958-273-3156

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: django-admin change form page validation

Hi

I understand that but the problem is its a condition which i have to add if the revisit checkbox is selected and then in interview_type dropdown None option is selected ; after pressing save it should throw an error .

None is an option in the dropdown . It is not blank=True and null =True

INTERVIEW_TYPES = (
       
        ('default', 'None'),
        ('Paired Visit','Paired Visit'),
        ('Time Series', 'Time Series'),
        
    ),

interview_type will show choices with dropdown 1) None 2) Paired Visit 3) Time Series

On Sat, Mar 31, 2012 at 10:28 AM, dummyman dummyman <tempovan@gmail.com> wrote:
Hi

unless u dont specify blank=True or null = True in modes for d corresponding fields, django will throw an errror if u don fill up the field

On Sat, Mar 31, 2012 at 9:25 AM, Nikhil Verma <varma.nikhil22@gmail.com> wrote:
Hi All

How can i apply validation in admin on various fields when they are dependent on each other ?

e.g. Let say in i have a  Field A(BooleanField)  and Field B (CharField) what i want to do is if in admin user select the Field A(checkbox) and does not enter anything in Field B
and if he tries to save ,it should throw an error like a normal blank=False gives. So how can i do this kind of validation in admin .

E.g  Use Case

I have a table having the following structure :-

INTERVIEW_TYPES = (
       
        ('default', 'None'),
        ('Paired Visit','Paired Visit'),
        ('Time Series', 'Time Series'),
        
    ),

class Interview(models.Model):
    ic_number              = models.CharField(verbose_name ="Visit Configuration Number",max_length=20,unique=True,null =True,blank=True)
    ic_description         = models.TextField(verbose_name ="Visit Configuration Description",null = True,blank=True)
    title                  = models.CharField(verbose_name ="Visit Configuration Title",max_length=80,unique=True)
    starting_section       = models.ForeignKey(Section)
    interview_type         = models.CharField(verbose_name = "Mapped Visit",choices=CHOICES.INTERVIEW_TYPES, max_length=80, default="Time Series")
    select_rating          = models.CharField(choices=CHOICES.QUESTION_RATING, max_length=80, default="Select Rating")
    view_notes             = models.CharField(choices=CHOICES.VIEW_NOTES, max_length=80, default="Display Notes")
     revisit                = models.BooleanField(default=False)   
.....and so on ......
  
    class Meta:
        verbose_name = 'Visit Configuration'
        verbose_name_plural = 'Visit Configurations'
       # ordering = ('rpn_number',)
   
    def __unicode__(self):
        return self.title

Its admin.py

class InterviewAdmin(admin.ModelAdmin):
    list_display = ('id','title', 'starting_section','ic_number','show_prior_responses')
    raw_id_fields = ('starting_section',)
admin.site.register(Interview, InterviewAdmin)

In admin , If i select the checkbox of revisit and in the field interview_type(which will show a dropdown having choices None,Paired Visit , Time Series) if a User has selected None from that dropdown and then press save button it should throw me an error like a normal blank=False shows, saying "This field is required"

How can i do this kind validation where fields are dependent on each other ? 

Please Ignore syntax error is any .

Thanks


--
Regards
Nikhil Verma
+91-958-273-3156

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Regards
Nikhil Verma
+91-958-273-3156

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: django-admin change form page validation

Hi

unless u dont specify blank=True or null = True in modes for d corresponding fields, django will throw an errror if u don fill up the field

On Sat, Mar 31, 2012 at 9:25 AM, Nikhil Verma <varma.nikhil22@gmail.com> wrote:
Hi All

How can i apply validation in admin on various fields when they are dependent on each other ?

e.g. Let say in i have a  Field A(BooleanField)  and Field B (CharField) what i want to do is if in admin user select the Field A(checkbox) and does not enter anything in Field B
and if he tries to save ,it should throw an error like a normal blank=False gives. So how can i do this kind of validation in admin .

E.g  Use Case

I have a table having the following structure :-

INTERVIEW_TYPES = (
       
        ('default', 'None'),
        ('Paired Visit','Paired Visit'),
        ('Time Series', 'Time Series'),
        
    ),

class Interview(models.Model):
    ic_number              = models.CharField(verbose_name ="Visit Configuration Number",max_length=20,unique=True,null =True,blank=True)
    ic_description         = models.TextField(verbose_name ="Visit Configuration Description",null = True,blank=True)
    title                  = models.CharField(verbose_name ="Visit Configuration Title",max_length=80,unique=True)
    starting_section       = models.ForeignKey(Section)
    interview_type         = models.CharField(verbose_name = "Mapped Visit",choices=CHOICES.INTERVIEW_TYPES, max_length=80, default="Time Series")
    select_rating          = models.CharField(choices=CHOICES.QUESTION_RATING, max_length=80, default="Select Rating")
    view_notes             = models.CharField(choices=CHOICES.VIEW_NOTES, max_length=80, default="Display Notes")
     revisit                = models.BooleanField(default=False)   
.....and so on ......
  
    class Meta:
        verbose_name = 'Visit Configuration'
        verbose_name_plural = 'Visit Configurations'
       # ordering = ('rpn_number',)
   
    def __unicode__(self):
        return self.title

Its admin.py

class InterviewAdmin(admin.ModelAdmin):
    list_display = ('id','title', 'starting_section','ic_number','show_prior_responses')
    raw_id_fields = ('starting_section',)
admin.site.register(Interview, InterviewAdmin)

In admin , If i select the checkbox of revisit and in the field interview_type(which will show a dropdown having choices None,Paired Visit , Time Series) if a User has selected None from that dropdown and then press save button it should throw me an error like a normal blank=False shows, saying "This field is required"

How can i do this kind validation where fields are dependent on each other ? 

Please Ignore syntax error is any .

Thanks

--
Regards
Nikhil Verma
+91-958-273-3156

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: changelist link in change_form.html

inside your folder template create admin directory
all admin html files shud be placed here
inside it create a dir for ur app
inside ur app a dir for ur model

so typically url will be

http://localhost:8000/admin/<app name>/<model name >/add

On Sat, Mar 31, 2012 at 2:22 AM, Lee <lhughes30@gmail.com> wrote:
I know this has to be simple but I'm not finding it in the archives or
google. I just want to include a link to the corresponding changelist
in every add/edit form. I assume I need to update the change_form.html
template, but what is the correct syntax to display the changelist
URL? A 1.3-compatible solution would be best.

Thanks for any help or ideas.

Lee

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

dummyman dummyman wants to chat

-----------------------------------------------------------------------

dummyman dummyman wants to stay in better touch using some of Google's
coolest new
products.

If you already have Gmail or Google Talk, visit:
http://mail.google.com/mail/b-39f62065b4-6ab0f5cba8-Hyccil_bE1jMXGxY1w4coCCKTtA
You'll need to click this link to be able to chat with dummyman dummyman.

To get Gmail - a free email account from Google with over 2,800 megabytes of
storage - and chat with dummyman dummyman, visit:
http://mail.google.com/mail/a-39f62065b4-6ab0f5cba8-Hyccil_bE1jMXGxY1w4coCCKTtA

Gmail offers:
- Instant messaging right inside Gmail
- Powerful spam protection
- Built-in search for finding your messages and a helpful way of organizing
emails into "conversations"
- No pop-up ads or untargeted banners - just text ads and related information
that are relevant to the content of your messages

All this, and its yours for free. But wait, there's more! By opening a Gmail
account, you also get access to Google Talk, Google's instant messaging
service:

http://www.google.com/talk/

Google Talk offers:
- Web-based chat that you can use anywhere, without a download
- A contact list that's synchronized with your Gmail account
- Free, high quality PC-to-PC voice calls when you download the Google Talk
client

We're working hard to add new features and make improvements, so we might also
ask for your comments and suggestions periodically. We appreciate your help in
making our products even better!

Thanks,
The Google Team

To learn more about Gmail and Google Talk, visit:
http://mail.google.com/mail/help/about.html
http://www.google.com/talk/about.html

(If clicking the URLs in this message does not work, copy and paste them into
the address bar of your browser).

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

django-admin change form page validation

Hi All

How can i apply validation in admin on various fields when they are dependent on each other ?

e.g. Let say in i have a  Field A(BooleanField)  and Field B (CharField) what i want to do is if in admin user select the Field A(checkbox) and does not enter anything in Field B
and if he tries to save ,it should throw an error like a normal blank=False gives. So how can i do this kind of validation in admin .

E.g  Use Case

I have a table having the following structure :-

INTERVIEW_TYPES = (
       
        ('default', 'None'),
        ('Paired Visit','Paired Visit'),
        ('Time Series', 'Time Series'),
        
    ),

class Interview(models.Model):
    ic_number              = models.CharField(verbose_name ="Visit Configuration Number",max_length=20,unique=True,null =True,blank=True)
    ic_description         = models.TextField(verbose_name ="Visit Configuration Description",null = True,blank=True)
    title                  = models.CharField(verbose_name ="Visit Configuration Title",max_length=80,unique=True)
    starting_section       = models.ForeignKey(Section)
    interview_type         = models.CharField(verbose_name = "Mapped Visit",choices=CHOICES.INTERVIEW_TYPES, max_length=80, default="Time Series")
    select_rating          = models.CharField(choices=CHOICES.QUESTION_RATING, max_length=80, default="Select Rating")
    view_notes             = models.CharField(choices=CHOICES.VIEW_NOTES, max_length=80, default="Display Notes")
     revisit                = models.BooleanField(default=False)   
.....and so on ......
  
    class Meta:
        verbose_name = 'Visit Configuration'
        verbose_name_plural = 'Visit Configurations'
       # ordering = ('rpn_number',)
   
    def __unicode__(self):
        return self.title

Its admin.py

class InterviewAdmin(admin.ModelAdmin):
    list_display = ('id','title', 'starting_section','ic_number','show_prior_responses')
    raw_id_fields = ('starting_section',)
admin.site.register(Interview, InterviewAdmin)

In admin , If i select the checkbox of revisit and in the field interview_type(which will show a dropdown having choices None,Paired Visit , Time Series) if a User has selected None from that dropdown and then press save button it should throw me an error like a normal blank=False shows, saying "This field is required"

How can i do this kind validation where fields are dependent on each other ? 

Please Ignore syntax error is any .

Thanks

--
Regards
Nikhil Verma
+91-958-273-3156

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Questions about UnicodeDecodeError

I have a situation where I am reading data that I have no control over and
inserting it into a db. The data is http headers. I am storing them in
postgres db in a text field and the db encoding is SQL_ASCII. Since the
data can be anything even non compliant http headers with anything for its
values I don't want to modify the data before I store it in the db.
However this is causing issues with certain values causing the
UnicodeDecodeError. For example I have a specific case where the user
agent is set to 'KC\xd4\xda\xcf\xdf\xc9\xfd\xbc\xb6'. I have been trying
to look for a way to deal with these cases gracefully in the models
__unicode__ method but nothing I have tried has worked.

Thanks,
Ali Mesdaq
Security Researcher
Cell: +1 (619) 952-8488 | Fax: +1 (408) 321-9818
Email: ali.mesdaq@fireeye.com

Next Generation Threat Protection
http://www.FireEye.com <http://www.fireeye.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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: svm python

Libsvm or scikit-learn are light

On Mar 30, 2012 6:19 PM, "Leotis buchanan" <LeotisBuchanan@exterbox.com> wrote:
Try shogun,it has python bindings
Regards
Leotis Buchanan
Co-Founder
Exterbox




On Fri, Mar 30, 2012 at 8:24 AM, dummyman dummyman <tempovan@gmail.com> wrote:
Thanks a lot.Any other alternative ?


On Fri, Mar 30, 2012 at 5:51 PM, Jeff Heard <jefferson.r.heard@gmail.com> wrote:
Look in Orange. http://orange.biolab.si/



On Mar 30, 2012, at 2:23 AM, dummyman dummyman <tempovan@gmail.com> wrote:

Is any one aware of svm implementation using python ? 
Apart from using weka tool ?


On Thu, Mar 29, 2012 at 9:21 AM, dummyman dummyman <tempovan@gmail.com> wrote:
Hi,

I am looking for svm classifier implementation in python. My input is a set of feature vectors of the form 
[Feature1,Feature2,[Feature3],Feature4] =>This is for a user

so the input is basically a multidimensional list in python

I have a set of users . So we have of multidimensional lists. 
Output should be confusion matrix or a statistical analysis 

Which is the best implementation of svm python module which suits these needs ?



--
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+unsubscribe@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+unsubscribe@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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: svm python

Try shogun,it has python bindings
Regards
Leotis Buchanan
Co-Founder
Exterbox




On Fri, Mar 30, 2012 at 8:24 AM, dummyman dummyman <tempovan@gmail.com> wrote:
Thanks a lot.Any other alternative ?


On Fri, Mar 30, 2012 at 5:51 PM, Jeff Heard <jefferson.r.heard@gmail.com> wrote:
Look in Orange. http://orange.biolab.si/



On Mar 30, 2012, at 2:23 AM, dummyman dummyman <tempovan@gmail.com> wrote:

Is any one aware of svm implementation using python ? 
Apart from using weka tool ?


On Thu, Mar 29, 2012 at 9:21 AM, dummyman dummyman <tempovan@gmail.com> wrote:
Hi,

I am looking for svm classifier implementation in python. My input is a set of feature vectors of the form 
[Feature1,Feature2,[Feature3],Feature4] =>This is for a user

so the input is basically a multidimensional list in python

I have a set of users . So we have of multidimensional lists. 
Output should be confusion matrix or a statistical analysis 

Which is the best implementation of svm python module which suits these needs ?



--
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+unsubscribe@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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Implementing Tagging with Django

On Fri, Mar 30, 2012 at 3:02 PM, Willy <willy1234x1@gmail.com> wrote:
> Django-taggit works quite well, I would suggest trying it over
> django-tagging

can you elaborate on why do you find it better? i have only tried
django-tagging some time ago, and maybe on a soon project would like
to do better

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

changelist link in change_form.html

I know this has to be simple but I'm not finding it in the archives or
google. I just want to include a link to the corresponding changelist
in every add/edit form. I assume I need to update the change_form.html
template, but what is the correct syntax to display the changelist
URL? A 1.3-compatible solution would be best.

Thanks for any help or ideas.

Lee

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.