Re: moving to django 1.2.1

2010-07-28 Thread Massimiliano Ravelli
On 28 Lug, 15:44, knight  wrote:
> Does anybody knows a good post or blog about the changes including
> csrf?

I forgot to suggest reading
http://docs.djangoproject.com/en/dev/releases/1.2/#backwards-incompatible-changes-in-1-2

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



Re: moving to django 1.2.1

2010-07-28 Thread Massimiliano Ravelli
On 28 Lug, 15:33, Maksymus007  wrote:
> The same all the sentences link '1.1 and 1.2 are compatible'.
> They are not.

You are right: that page doesn't mention csrf changes.
I upgraded few installations from 1.0 and from 1.1 to 1.2
and the only undocumented change I remember is exactly the csrf.
I just added {% csrf_token %} after form tag in every template.
as you can read in 
http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-to-use-it

> I have quite big application written in 1.1 - still can't fully run it on 1.2.
> As I discovered: forms fields set to be blank=True and null=True when
> left blank on 1.1 get null value as expected, on 1.2 the get empty
> string - which crashes if database has constraints.

Sorry but I didn't encounter this problem.
Besides the csrf, all my upgrades went smoothly.

Regards
Massimiliano

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



Re: moving to django 1.2.1

2010-07-28 Thread Massimiliano Ravelli
On Jul 28, 3:13 pm, knight  wrote:
> What are the minimal changes that I need to make in order to work with
> 1.2.1?

Did you have a look at 
http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges
?

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



Re: 1 django Project / 2 designs

2008-04-17 Thread Massimiliano Ravelli



On 15 Apr, 10:41, martyn <[EMAIL PROTECTED]> wrote:
> I want a default saison (that could be stored in my settings file).
> It's not only a different design but it's also a different content
> sometimes.
>
> Is this can be done with middleware ? session ?
> I don't really know this aspect of django.

What about a redirect ?

from django.http import HttpResponseRedirect
def home_page(request):
return HttpResponseRedirect("http://domain.com/winter/ ")
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django version for production?

2008-02-05 Thread Massimiliano Ravelli

On 5 Feb, 14:45, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> If anyone can afford running on trunk (as I do with my personal
> projects), then there's no reason to run on 0.96.

I agree: I'm running a very recent version of newforms-admin branch in
my *production* site with no problem at all.
Please note that upgrading from an older version, despite all the
operations are well documented, can be quite demanding
(especially if you don't proceed  step by step).

Regards
Massimiliano

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



Re: Preferred Schema Evolution Tool

2007-11-27 Thread Massimiliano Ravelli

On 25 Nov, 10:21, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> What is the recommended method to do this right now, what are you all
> using, just plain SQL? Basically, I'm looking for the best solution to
> this problem and would like to know what the community recommends.

I can't raccomand you any of these but I can say that, after
a long waiting, I found the project *I* like and fits *my* needs:
Django Evolution.

Here's some point about django evolution:
- good documentation
- clean and elegant (like django ;-) )
- works with a recent version of trunk
- intergrates with django management without patching it
  (thanks to the recent version of django itself)
- I can avoid to add information about evolution to my models
- helps to track and apply changes to the database.

I know: it can handle automatically only few case.
It doesn't support DeleteModel mutation... but I don't care:
I know a bit of sql and I can write a "DROP TABLE" statement. ;-)


I read the documentation of all these projects to make my choice.
As it doesn't take to much time, I advise you to do the same
to chose the project that better  fits your needs.


Regards
Massimiliano

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



Re: Unicode branch merged into trunk

2007-07-05 Thread Massimiliano Ravelli

Great work Malcolm !
Thank you very much.

On 4 Lug, 14:41, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> Thankyou to this group of early adopters for your early testing feedback.

Well, as an early adopter of unicode branch, I should have reported
that in a few weeks of usage I didn't find any problem. Shame on me !

Regards,
Massimiliano


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



Re: newforms, choices and models

2007-03-12 Thread Massimiliano Ravelli

On 12 Mar, 11:31, enquest <[EMAIL PROTECTED]> wrote:
> However one question is still open!

Did you look at my previous post ?

Massimiliano


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



Re: newforms, choices and models

2007-03-11 Thread Massimiliano Ravelli

On 11 Mar, 15:09, enquest <[EMAIL PROTECTED]> wrote:
> I'm using/learning the newforms... I got a model, in this model I have a
> choices list ( ('1', 'foo'), ('2', 'bar' ) that are reprensented as
> select box in the admin...
> However when I import this class to the newforms
> "forms.form_for_model(Gadget)" the choices arn't coming along and the
> field is reprented as a normal textfield... How come?

There is an open ticket about this argument: #3268.

I wrote a simple work-around:

choices = ( ('1', 'foo'), ('2', 'bar' ) )
myform = form_for_model(Gadget)
myform.fields['field_name'] = ChoiceField(choices=choices)

If you need to use form_for_instance remember to update
the initial value or you will not see the saved value pre-selected
on the select box.

choices = ( ('1', 'foo'), ('2', 'bar' ) )
myform = form_for_instance(Gadget_instance)
initial = myform.fields['field_name'].initial
myform.fields['field_name'] = ChoiceField(choices=choices,
initial=initial)

Hope this helps.

Massimiliano


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



Re: Getting values from a drop-down menu

2006-12-13 Thread Massimiliano Ravelli


Matt Williams wrote:
> 
> A

> but I keep getting an error about an empty MultiValuedDict {}, which I
> think means that I'm not getting the values back.

Try:


A
...


and then read request.POST['letter'] 

Massimiliano


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



Re: How do I make a self-referential Many to Many relationship optional?

2006-12-13 Thread Massimiliano Ravelli

Austin Govella wrote:
> How do I make the self-referential Many to Many relationship optional?

Try to add "null=True".

Massimiliano


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



Re: Changemanipulator and follow true

2006-12-13 Thread Massimiliano Ravelli

[EMAIL PROTECTED] wrote:
> I have to keep the Address on Company... as Address will be being used
> in other places as well..and is not always related to a company... I
> have a Property and User classes as well..and each of them will have an
> Address foreign key.

Well, I think we'll have to wait the answer of some experienced django
user.

> In my form I'm using the following ( I tried putting a 0 in there like your
> sample..but it gave an unindexable object error )

In that sample I moved the foreign key on the other model.

> Now in my company definition I have:
> class Company(models.Model):
>company_id = models.AutoField(primary_key=True)
>parent_company = models.ForeignKey("self",null=True,blank=True)
>address =models.ForeignKey(Address,unique=True,edit_inline=models.TABULAR)

You've got a one-to-one relation (unique=True).
I suppose that using the Address ChangeManipulator could do the trick.

> I can't use the address...because an address will be on a company object..
> as well as some others I have..not just only on a Company object.

You can use Address ChangeManipulator and hide fields from other models
with the follow argument.

> but maybe I just can't do this the way I'm wanting...

There's always a way !
Remember you can always code all by hand (like a lot of web-developer
usually do).
At the very beginning I was writing a lot of code to make the things
exactly like I wanted, but as time passed, I discovered that django
could do the same thing with less effort (and code).
And then... zac... dozens of lines of my code gone !  It's a great
pleasure. :-)

Massimiliano


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



Re: Changemanipulator and follow true

2006-12-13 Thread Massimiliano Ravelli

[EMAIL PROTECTED] ha scritto:

> I'm not using the admin interface though...will this work with that?
> (I'll give it a shot and see)

edit_inline argument works well with both admin interface and custom
views (I'm using the latter).

Massimiliano


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



Re: Changemanipulator and follow true

2006-12-12 Thread Massimiliano Ravelli

I hope I understood your problem (as my english is ugly).
I have a similar application: note that I put the foreign key on
Address.

class Address(models.Model):
address_id = models.AutoField(primary_key=True)
# Here's the foreign key (note the edit_inline)
company = models.ForeignKey(Company, edit_inline=models.TABULAR)
status_id = models.IntegerField(null=True, blank=True)
...

class Company(models.Model):
company_id = models.AutoField(primary_key=True)
parent_company = models.ForeignKey("self",null=True,blank=True)
### address = models.ForeignKey(Address)
company_name = models.CharField(blank=True, maxlength=150)
...

I had no problem with ChangeManipulator (and with a custom manipulator
too). Moreover you don't need to specify the follow argument.

If you want to keep the foreign key on Company I suppose you must use
the Address ChangeManipulator and specify the edit_inline argument.

In the template you have to add a 0 (zero) to identify the first
address. If you want only one Address per Company you can make the
relation one to one  adding unique=True to the company field.

Street #:{{
form.address.0.street_number }}

If you want more documentation, search edit_inline here
http://www.djangoproject.com/documentation/model_api/#relationships

Hope this helps you.

Massimiliano


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