Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-11-26 Thread ferran
Hello,

For the url pattern www.example.com/xxx/cache/[hex] it's a bug in chrome 
extension  extension ID bodddioamolcibagionmmobehnbhiakf 
http://code.google.com/p/chromium/issues/detail?id=132059

El jueves, 19 de julio de 2012 09:21:20 UTC+2, Thomas Orozco escribió:
>
> Did you visit the page where the broken link exists with the same browser 
> as your user and searched for :
>   + JS warnings 
>   + JS errors 
>   + Requests on the broken link 
>   + The actual broken url somewhere in the DOM tree 
>
> Chrome has an integrated full featured debugger, you could use it. 
>
> The problem isn't going to automatically go away nor the explanation show 
> up in your mailbox. 
>
> Le 10 juil. 2012 09:21, "ferran" <pink...@gmail.com > a 
> écrit :
> >
> > Hello Melvyn,
> >
> > I'm found this information 
> http://stackoverflow.com/questions/11017609/undefined-randomly-appended-in-1-of-requested-urls-on-my-website-since-12-jun
> >
> > I'm have too:
> >
> > Referrer: http://www.marquezshop.com/es/catalogo/ofertas/
> > Requested URL: 
> /es/catalogo/ofertas/cache/a8790cb719ffd4424219786bc76da1a4/
> > User agent: Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/536.11 
> (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11
> > IP address: x
> >
> >
> > What is cache/hash?
> >
> >
> > Thanks in advanced
> >
> >
> >
> >
> >
> > On Wednesday, July 4, 2012 2:47:20 PM UTC+2, Melvyn Sopacua wrote:
> >>
> >> On 4-7-2012 9:55, ferran wrote: 
> >> > Hello, 
> >> > 
> >> > I'm update javascript libraries: 
> >> > - Jquery from 
> >> > http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to 
> http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js 
> >> > - Jquery ui from 
> >> > http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.jsto 
> http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js 
> >> > 
> >> > But not is a solutions, the problem persist... 
> >>
> >> Upgrades aren't solutions. They only dress up as them in their spare 
> time. 
> >>
> >> You should: 
> >> 1) Identify where you generate links via javascript 
> >> 2) Identify what javascript variable is passed to the link 
> >> 3) Identify how it can be undefined 
> >>
> >> If you don't see how it can be, undefined, use the appropriate 
> >> javascript forums / documentation. 
> >>
> >> -- 
> >> Melvyn Sopacua 
> >>
> >>
> > -- 
> > 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/-/O8_xSSwcqnUJ.
> >
> > To post to this group, send email to django...@googlegroups.com
> .
> > To unsubscribe from this group, send email to 
> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ia9M1h-nPAEJ.
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: many "Broken INTERNAL link" with end string "/undefined/"

2012-07-10 Thread ferran
Hello Melvyn,

I'm found this information 
http://stackoverflow.com/questions/11017609/undefined-randomly-appended-in-1-of-requested-urls-on-my-website-since-12-jun

I'm have too:

Referrer: http://www.marquezshop.com/es/catalogo/ofertas/
Requested URL: /es/catalogo/ofertas/cache/a8790cb719ffd4424219786bc76da1a4/
User agent: Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/536.11 (KHTML, like 
Gecko) Chrome/20.0.1132.47 Safari/536.11
IP address: x


What is cache/hash?


Thanks in advanced





On Wednesday, July 4, 2012 2:47:20 PM UTC+2, Melvyn Sopacua wrote:
>
> On 4-7-2012 9:55, ferran wrote: 
> > Hello, 
> > 
> > I'm update javascript libraries: 
> > - Jquery from 
> > http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to 
> http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js 
> > - Jquery ui from 
> > http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js to 
> http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js 
> > 
> > But not is a solutions, the problem persist... 
>
> Upgrades aren't solutions. They only dress up as them in their spare time. 
>
> You should: 
> 1) Identify where you generate links via javascript 
> 2) Identify what javascript variable is passed to the link 
> 3) Identify how it can be undefined 
>
> If you don't see how it can be, undefined, use the appropriate 
> javascript forums / documentation. 
>
> -- 
> Melvyn Sopacua 
>
>
>

-- 
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/-/O8_xSSwcqnUJ.
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: many "Broken INTERNAL link" with end string "/undefined/"

2012-07-04 Thread ferran
Hello,

I'm update javascript libraries:
- Jquery from 
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to 
http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
- Jquery ui from 
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js to 
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js

But not is a solutions, the problem persist...

Thanks in advanced

On Thursday, June 28, 2012 3:24:39 PM UTC+2, ferran wrote:
>
> Hello Melvyn,
>
> Ohhh in the javascript!. you're good I view my libraries and update 
> it's necessary (Jquery, etc.).
>
> see you with the response of the re-code javascript
>
> Thanks
>
>
> On Thursday, June 28, 2012 2:59:12 PM UTC+2, Melvyn Sopacua wrote:
>>
>> On 27-6-2012 18:37, ferran wrote: 
>>
>> > In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL 
>> link" 
>> > how this: 
>> > 
>> > " 
>> > Referrer: http://www.marquezshop.com/es/catalogo/sales/ 
>> > Requested URL: /es/catalogo/sales/undefined/ 
>> ^ 
>> That's javascript, not python doing that. Python would be 'None'. So 
>> check your javascript code for Google Chrome compliance. 
>>
>> -- 
>> Melvyn Sopacua 
>>
>>
>>

-- 
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/-/iCSOm2ZpKscJ.
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: many "Broken INTERNAL link" with end string "/undefined/"

2012-06-28 Thread ferran
Hello Melvyn,

Ohhh in the javascript!. you're good I view my libraries and update 
it's necessary (Jquery, etc.).

see you with the response of the re-code javascript

Thanks


On Thursday, June 28, 2012 2:59:12 PM UTC+2, Melvyn Sopacua wrote:
>
> On 27-6-2012 18:37, ferran wrote: 
>
> > In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL 
> link" 
> > how this: 
> > 
> > " 
> > Referrer: http://www.marquezshop.com/es/catalogo/sales/ 
> > Requested URL: /es/catalogo/sales/undefined/ 
> ^ 
> That's javascript, not python doing that. Python would be 'None'. So 
> check your javascript code for Google Chrome compliance. 
>
> -- 
> Melvyn Sopacua 
>
>
>

-- 
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/-/Orst_QWb4LkJ.
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: many "Broken INTERNAL link" with end string "/undefined/"

2012-06-28 Thread ferran
Hello Russ,

In the view code of this pages I don't found de keyword "undefined"

Thanks in advanced

On Thursday, June 28, 2012 1:38:22 AM UTC+2, Russell Keith-Magee wrote:
>
> On Thu, Jun 28, 2012 at 12:37 AM, ferran <pinksh...@gmail.com> wrote: 
> > Hello django users, 
> > 
> > In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL 
> link" 
> > how this: 
> > 
> > " 
> > Referrer: http://www.marquezshop.com/es/catalogo/sales/ 
> > Requested URL: /es/catalogo/sales/undefined/ 
> > User agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like 
> > Gecko) Chrome/19.0.1084.56 Safari/536.5 
> > IP address: --- 
> > " 
> > or 
> > 
> > " 
> > Referrer: 
> > 
> http://www.marquezshop.com/es/catalogo/sales/sal-compactada-en-pastillas-piscinas-salnet.html/
>  
> > Requested URL: 
> > 
> /es/catalogo/sales/sal-compactada-en-pastillas-piscinas-salnet.html/undefined/
>  
>
> > User agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like 
> > Gecko) Chrome/12.0.742.122 Safari/534.30 
> > IP address:  
> > " 
> > 
> > The pattern from requested URL can be any, but, always have a end string 
> > "/undefined/" 
> > 
> > I'm not update the code, but update, nginx, mysql, apache 
> > 
> > Program versions: 
> > django 1.1.4 
> > localeurl 1.5 (tip version) 
> > 
> > Do you have any Idea? 
>
> It's impossible to say without seeing all your code, but you only get 
> those emails if there is a link on your page that returns a 404. That 
> means that pages on your site are being rendered with  href=".../undefined/"> on them. 
>
> The link may not be in an obvious location -- I'm going to guess that 
> they've been found by a robot that is scraping your site -- but if 
> your getting the emails, you can be fairly certain that the links 
> exist *somewhere*. 
>
> Yours, 
> Russ Magee %-) 
>

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



many "Broken INTERNAL link" with end string "/undefined/"

2012-06-27 Thread ferran
Hello django users,

In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL link" 
how this:

"
Referrer: http://www.marquezshop.com/es/catalogo/sales/
Requested URL: /es/catalogo/sales/undefined/
User agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like 
Gecko) Chrome/19.0.1084.56 Safari/536.5
IP address: ---
"
or

"
Referrer: 
http://www.marquezshop.com/es/catalogo/sales/sal-compactada-en-pastillas-piscinas-salnet.html/
Requested URL: 
/es/catalogo/sales/sal-compactada-en-pastillas-piscinas-salnet.html/undefined/
User agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like 
Gecko) Chrome/12.0.742.122 Safari/534.30
IP address: 
"

The pattern from requested URL can be any, but, always have a end string 
"/undefined/"

I'm not update the code, but update, nginx, mysql, apache

Program versions:
django 1.1.4
localeurl 1.5 (tip version)

Do you have any Idea?

Thanks in advanced
Ferran




-- 
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/-/RewwbdcQ8ywJ.
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: ModelForm validation in 1.2.3

2010-12-30 Thread Ferran
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 30/12/10 17:25, Burhan wrote:
>  In 1.2.3, this logic always fails because "is_clean()" fails if an
> existing customer enter's their email address. How can I do the same
> using django 1.2.3?

http://docs.python.org/tutorial/errors.html
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJNHLQCAAoJEAWOKfEESaOw/KkQAJpykIq4NuWT2pFlzT/jg2Ck
ZLPnKTABp7JmvDdNflreKhKDKmhMSmYTu9/ThF8RtGgtstq5oUtdhZmKoRnpnuWe
GHFPPidSBD9NOs1MFgj1+8kkvcTFLE6kPRupfNN9nJKFm4gZ8dpV602WOJWlK1dJ
4ViK5fFU4AwOoGpqZrmMG6J8bzOKs6U6rNJP4YLSvMyRyEOj5qVwAo9x4V+NpgHg
5NiWADvWnwISc7QdB84ViYsmF3ocIIZnzAgLbRa7kej/8NQ/ikndc7gAvjpseJi7
R3GiaW816m/PElkXlbiszKxjJQSYP9uDfzURJ9oJyU5LNa1cNkr1RrWAtlh/j5RI
mCwyq7I7MbFodsJe7ZGpUzspZfyk9lxSYAfaVZcE9v9fVJc1y6JbW0KyMl3MJyZG
K0x+PA+X03gEDnr9fso3cijBc1gz3sVGyj3C5rOgaCnlasRQzbjcjOaIx8GpUTgU
4OgP5k/Agz6eYr08JES1cvOeug7TYGY4x84MRwe++RgaOhf/1W7v4Hrvm22hBGcA
ivBr0xt0rdzCQKeX2JriDMcqWE99KTEEqqWX4bA1l47UiaWg16wvyoxgexQT7Y0O
larKwMr/5G9+2fQOoYzHL9EcDmzzWJHNjrIZmjrIMv+6fQ5b30aTIh+qI8yvg2vw
roI7MOFS6TYefl0QhP8R
=jP4n
-END PGP SIGNATURE-

-- 
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: database migration

2010-12-30 Thread Ferran
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 30/12/10 13:17, Torsten Bronger wrote:
>> Is there a bug report for this issue? I find that very
>> > disappointing.
> http://1.2.3.12/bmi/stc.celeb.gate.cc/banner/pi/0120.gif

What i found disappointing is sending a NSFW image to a django list
without a note.

Thank your for my first post-xmas first boss talk :D
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJNHIMpAAoJEAWOKfEESaOw7rEQAI8AUH7EeF51ZocVJJOzi5sa
gavH1N9MesBtEiraN1t+sQyXy7m/wzlO4qRbhDkb56V8LrS2UME6kse7OY6TmmLV
Qkmqfmg4s0RdVQnWaOPEQax0oqb19kwjetr2HSleVV/uWB6DV5xiDVqojtuP7s9x
Tj3PJs8V1kUBpK5twHkRFSJRFqv5Yy/KRNiOdLXrRpenqivbqVHb8jwLPtZFN4Cc
FSpOljQ/A08jI644vhfUCOQJuI40IRaRQjVINolRhqmR5i0nI7ZOEz/rIgksgiIq
m+T//vuXKfJJ7QxMw5zl8ERpqwl67uebkKEeeFgKzIW8Y1v39OWNcK0TkJlI3bgW
MHicwZ+TNkmzNwINPDbnuNiBmZdLE6Ypg+Cng5na4j7IKr/aiyRcRAQl2MWR67XK
hS+MPCmEZMyPFVyM0cnKz3DIMhVZWXVyCu6rf1iR4yyI/5FAdYLxAwsRKGeh9Llp
BLM4fozVrkx6aUnEaAgLpaOLTSD41M3lQiIlT/NtXM3zqWUWWFtYZT2/m5XwWins
yaeFSHiYobmAuYz6Z6uwLLsejpsv/TTLpuxi5vyOWAVZd1UBdTnLtYEtX5+twrur
/4qHgxs8S7y3XnDvc/Hei1sDq9QA9OLs+UXD8cOHqtFrDoS22g7rxzQnU2dSsal8
GdMSrAYBtIjeTnqJSiLS
=tOGZ
-END PGP SIGNATURE-

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



Re: Problem with ForeignKey to an abstract class

2010-12-01 Thread Ferran
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 01/12/10 12:48, Ferran wrote:
> I've thought maybe i can implement contacts and ns fields in both
> DomainOwned and DomainPending, using generic relationships, but it
> does not seems right to me.

Shame on me.

This is the right way to do it, the only way, in fact.

I really want django to solve it with his own magic, but... no.

My solution:


# class DomainUbi

change:

contacts = models.ManyToManyField(
contacts.Contact,
through='ContactType'
)

to:

contacts = GenericRelation('ContactType')

# class ContactType

change:
domain = models.ForeignKey(DomainUbi)
to:
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey()


change:
unique_together = ('contact', 'domain', 'role')
to:
unique_together = ('contact', 'role', 'content_type', 'object_id')

Thank you!
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJM9ncHAAoJEAWOKfEESaOwVYQP/1V6w8UZn1NkLWS3YC49QDkC
QRlLpzUNH13pkYOXYF+2kEL6x1ZGCyL2G33R86485Ea/KP8kLo0TJT+nEn2sjFaW
0adG13w6yoXsE0Khot9vqDwKzqBKhpt2SMXxs4nCGjE66D1bUjRutq/xMgIY8EM+
6DJr1B7u1/n5jH/TKOOmfn3xcpo16Fe3rYc5udVoxa6tWdbMHIakozI2pkec+AMU
kDOlQg3OROCSSzurcjCybN4YNRW6bEM+9auh/jPaRXTry9vfy7wZyCn0Oije9knL
8l0v2JUZbmZTlZpFTX+oM/sziKN8s6EhgDWBH3Ii3WwapMFcEMa9vo8Ejb7SQUPL
HlfCxjjkeOHP07Eb/OkpWO7uACA2SF2Z4XLLG3+kxT9fP6trwRa2N0/8pZ+JFDh2
/ujTtGCGQIfG5dbjXB3sZfmT6h191MKMhKSpxmGfpH1JqFVQ6NIc7Kd3OwnKYi99
bYlFb3O1j2MwslTxrMxhhMOizdo0QEIbUYIdHCYXyes4ibecD7ZufT2tF6D/Y4P+
BLzj5ASqyRrnfWHNq1NRjLHm0CT27iXhMjn4AQjXae9vp1gUNMwA6d5h0LQmahTG
2bQ8VOxWvHwbjbJpTjHIcGt4396hkTa/Zcca4JuD5MwdHGvc8tqgpM4JYv9vw4m4
JM8ncLHB8bem+UoiquGk
=BCc+
-END PGP SIGNATURE-

-- 
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: Problema con ForeignKeys hacia una tabla abstracta

2010-12-01 Thread Ferran
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 01/12/10 12:57, Ferran wrote:
> Buenas tardes a todos;

Sorry list, this mail was intended to a spanish django list.

Ignore this mail, thanks.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJM9jiJAAoJEAWOKfEESaOw5X8P/2xbRhGXX0AtpGsLbRtve+Y8
eFlPZgBucOdBNU+wVN3EEE3bfBUv5tY4LK0TKYb4OnWbYsfhi3TW2AmKiBfchPYV
KK19fVh7fyRawsTtmSWvxG8q29i+2DFNvc3mgG8UdJMAuImbxz2tOIvR6p7y2XPI
RfSk4H5pRvC7jtZ/lbHU05PSHw4odoT0+0tOa2ZQIJ42uJvfIViMi90P9HEVhhiP
MpM+jus4YJfkRxqDMS9t/6D+4epnXnS5jiuS8KUsWzJL2V7UbhyoRVWrqr3GavKS
oHxCeufcRaXrcNhob3Zo0sHSvq194SPHZBQt0RFjjuz5ZACOHERDVfyjsNlGLo8L
JyWNhRSoh4SY5UntQnkPzN8Ol+cNY+TP7TLO6ENjDNLI7hxwyarms78gwtIiOtDp
AkboZUy2BpbzqcVBMvnpH2YnWAAoCNiQ2qjb1Nm3LtlGYRbseOsT8Iu3Ofl0tWLZ
LLfBCUQvzzJN3H5yqtSHRbbEq0oNBot52P05UL6gYbX+wMl6hs0xjqq65567uOQT
G2kugUZ8BRcWZv/oyCZ8Agd2lOn8VZ4zR3/KFlvE+h9eh6upme7PupF/RYUEBuS/
//XyQs092q80xfdqFQaGpv3GVA5KG71LKvc4KdChCrg4aGRzjIGZR9wxBizhvLHT
zaEUbvFDcljczp6Z3eEy
=v/YG
-END PGP SIGNATURE-

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



Problema con ForeignKeys hacia una tabla abstracta

2010-12-01 Thread Ferran
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Buenas tardes a todos;

Quiero tener ForeignKeys hacia el modelo padre en las tablas intermedias
(manytomany trough) para tener entradas únicas en las mismas.

El problema es que quiero que este modelo padre sea abstract, ya que
nunca querré instanciarlo, utilizando DomainOwned o DomainPending en vez
de esta.

El error que tengo es este:

  File "/home/ferran/intranet/domains/models.py", line 48,
in ContactType
domain = models.ForeignKey(DomainUbi)
  File
"/usr/lib/python2.7/site-packages/django/db/models/fields/related.py",
line 808, in __init__
assert not to._meta.abstract, "%s cannot define a relation with
abstract class %s" % (self.__class__.__name__, to._meta.object_name)
AssertionError: ForeignKey cannot define a relation with abstract
class DomainUbi

En las foreignkeys a DomainUbi, tanto en ContactType como en
AssociatedNameServer.

Había pensado que podría implementar los fields ns y contacts en ambas
tables (DomainOwned y DomainPending), utiliando generic relationships,
pero no me parece correcto.

Alguien me puede echar una mano?
- ---

class DomainMinimal(models.Model):
sld = models.CharField(
max_length=63
)
tld = models.ForeignKey(common.Tld)
name = property('_domain_name')

def _domain_name(self):
return u'%s.%s' % (self.sld, self.tld)

def __unicode__(self):
return self.name

class Meta:
abstract = True


class DomainUbi(DomainMinimal):
owner = models.ForeignKey(contacts.Contact, related_name='Owner')
contacts = models.ManyToManyField(contacts.Contact,
through='ContactType')
ns = models.ManyToManyField('NameServer',
through='AssociatedNameServer')
period = models.IntegerField(validators=[MaxValueValidator(10)])

class Meta:
abstract = True

class DomainOwned(DomainUbi):
crdate = models.DateField()
exdate = models.DateField()

class DomainPending(DomainUbi):
status = None # just an example, now


class ContactType(models.Model):
contact = models.ForeignKey(contacts.Contact)
domain = models.ForeignKey(DomainUbi)
role = models.CharField(
max_length=10,
choices = (
('admin', 'Administratiu'),
('billing', 'Facturacio'),
('tech', 'Tecnic'),
)
)
class Meta:
unique_together = ('contact', 'domain', 'role')

class AssociatedNameServer(models.Model):
ns = models.ForeignKey('NameServer')
domain = models.ForeignKey(DomainUbi)
priority = models.IntegerField(
validators=[MaxValueValidator(4)]
)
def __unicode__(self):
return "%s (%s)" % (self.ns.host, self.ns.ip)

class Meta:
unique_together = ('ns', 'domain', 'priority')

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJM9jhAAAoJEAWOKfEESaOwaOgP/36oNmwpYoYkqhuYYuR53Vge
YnIAnMoEIJIze9V4zJhDDWGcvRy8cjz86oqdLQ6Qg3BA+1JxrYML3GY4BWAAslrB
SAPKNfSjP5zspNdfEHrmnq1/bEQnqeeRor5AmfyXUhMBWdE26cCiMWgZVE+M6L6i
+jMku/50COW4JUk55mOE54KdicQ5ChCCWBv1G3aP9mBoMkKQLkLAvTK4DY+bv2xm
vWxXdyjKTGjF5Ck8JSXtq4N7rJev68eoTaK+lc392vkqTrQOrOgDan60hoiej8Dk
cr0ITh9fQuIV59tbL2Bf8vYK8OR3yWoVdL+lfw6xbdovq4qVpjDj01ZN3a42+Mvx
0HFJfnGUhu6zlK1LZWAayIGS+bDnwbvIDkVcx5GxnmQYM9jomMojiirhGttx6mlc
zMPXRzFAw2YyWtFYpSn2bA4e42G83sssRqaQlVdNeGFzP6I4Y67I5TDrPgd1tTKJ
QyC1eFNRxhfoRcYVfYMoTSFBd2FLpLPzMb3cNm3GOeasEgxlj3p1nBErljCdBl2w
jyMLE4/bov63szC78iThMuyV+AxO8ENmLe+NRkHMMToHp6eoyikZR9jRhcAJN0nG
UoQObbeRtNBeko63qwykWOHJgZ+zrkRIk2X3rfbHiW0zXcsWXXBReE+eO7mWIbdY
CrByJHKi89DUea6mUtQ4
=S6Gj
-END PGP SIGNATURE-

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



Problem with ForeignKey to an abstract class

2010-12-01 Thread Ferran

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hello everyone,

I want to have foreign keys to parent model on a manytomany
intermediate table (through) to have unique entries for that domain.

The problem is i want this parent model class to be an abstract one,
because i don't ever want to instantiate it, using DomainOwned or
DomainPending instead.

The error i'm getting is this:

  File "/home/ferran/0_ubilibet/intranet/domains/models.py", line 48,
in ContactType
domain = models.ForeignKey(DomainUbi)
  File
"/usr/lib/python2.7/site-packages/django/db/models/fields/related.py",
line 808, in __init__
assert not to._meta.abstract, "%s cannot define a relation with
abstract class %s" % (self.__class__.__name__, to._meta.object_name)
AssertionError: ForeignKey cannot define a relation with abstract
class DomainUbi

On both the foreignkeys to DomainUbi on models ContactType and
AssociatedNameServer.

I've thought maybe i can implement contacts and ns fields in both
DomainOwned and DomainPending, using generic relationships, but it
does not seems right to me.

Can anyone help me on this, please?

- ---

class DomainMinimal(models.Model):
sld = models.CharField(
max_length=63
)
tld = models.ForeignKey(common.Tld)
name = property('_domain_name')

def _domain_name(self):
return u'%s.%s' % (self.sld, self.tld)

def __unicode__(self):
return self.name

class Meta:
abstract = True


class DomainUbi(DomainMinimal):
owner = models.ForeignKey(contacts.Contact, related_name='Owner')
contacts = models.ManyToManyField(contacts.Contact,
through='ContactType')
ns = models.ManyToManyField('NameServer',
through='AssociatedNameServer')
period = models.IntegerField(validators=[MaxValueValidator(10)])

class Meta:
abstract = True

class DomainOwned(DomainUbi):
crdate = models.DateField()
exdate = models.DateField()

class DomainPending(DomainUbi):
status = None # just an example, now


class ContactType(models.Model):
contact = models.ForeignKey(contacts.Contact)
domain = models.ForeignKey(DomainUbi)
role = models.CharField(
max_length=10,
choices = (
('admin', 'Administratiu'),
('billing', 'Facturacio'),
('tech', 'Tecnic'),
)
)
class Meta:
unique_together = ('contact', 'domain', 'role')

class AssociatedNameServer(models.Model):
ns = models.ForeignKey('NameServer')
domain = models.ForeignKey(DomainUbi)
priority = models.IntegerField(
validators=[MaxValueValidator(4)]
)
def __unicode__(self):
return "%s (%s)" % (self.ns.host, self.ns.ip)

class Meta:
unique_together = ('ns', 'domain', 'priority')
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJM9jX2AAoJEAWOKfEESaOw1xIP/2ijO1VOXmnxoT1VdiuilcgP
qK+9YXS7Y6bwIhy9zGHF5QB/wAVQyYbYEA/mpLPP09ShA7LV2qO5ZRsdR0TYChfF
P/mVoz73BSkFQLw+B4rS2XCTfXCzumFEslrqWtSAyNnxU1+LjtT/GpFfxldU3PiF
oNnNbAJSjLdd1OvtIP7I3iquj+AV5iuzSDmi38zL5xT9mF75+hg0TXkcA04KMNKJ
AfvZ3j5ofRHJCwpu1jYtE85OzXWasffJeYvXiPLHGHb/Pdp0WwvFCBTb9nIRwVVR
mt/d5lIp6ATuakCxMz9TDM3wf0+81ynGI9s/csZuY3c0RAlKpkzgYMYARC81haiQ
mKJJgQ9J9IHcry9XcMcOZ+x4j+c5JYvNQx5YI+LAuLdXGqzlmQ9mz3Ur0Jsu9H5I
b1wOSiIqDF6uITjCjqlQL1zrSgPSD1NKSBzSm/LO3bBjEqqZL31K7NNUtN70GGhS
Qb85TxpitLHMBhsPjQhi6248CoL5s3/MkPHC9JHajPa2G6ZT+gR7tCiXnkmURdU6
UO1YelGx751GUTRZQxhBPorNHgMPtYrZ4+fPfGVxWfjG1vXS9WXgs4O+xYaIpnMK
lCmX431JJstDHFERbc48qvnuyvy0QX4J1iRsbVJJ8yjYG8vSRzKSFMksibH+PCHl
5UipC5zZfUyxNWR8/bDS
=nHpW
-END PGP SIGNATURE-

-- 
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: php script in django app

2010-12-01 Thread Ferran
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Maybe this?

http://pythonpaste.org/wphp/

- -- 
Abordemos el parlamento! -- http://pirata.cat
En democracia, dos Belén Esteban valen más que tú
Di NO al top-posting!
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJM9hS2AAoJEAWOKfEESaOwmuQQALZpz9hc5UlSoL3EDKMdh3qW
oPOVBqwu1v+8CtOJRh5dIwxNILBuWuyIM5bJLwGcLBK1BPvs2Sw+OHBytqGpgSIe
d1dWd5p755UHCdPeQjn06BcptCbv+9DoUSufmEBNZe7QurZ/ggQL+7bZKTDmuXyw
n9V93Q0SMeSC1pBjElw01eQaHOJ6OCmmebwmkF5UfVpClEL5j2qV+ksRwUG+yd3P
zxhcN/tGTyLcbG2A4GQby651Lb3G4d1UrtpRA5mOS0lFRE0AzRomLc+eVXv1tUpO
Wk6UX3HIsgiILL27DgC03q1/eXZKmwkDx0xF+eVbYBNs6gjw1MFQAzW7Tf2bqe/D
vkspRQbO6DMj1piKOkT7+b+YH63pE5yZ3QmUlNnydjf4qzeJfEa2AWL0rDUZvHTO
IX1FRUTr7tNIKAtLC1FKwb33powpm170a0Hm87onmoobv/rg9+U4ulKtFpk4/XF4
9X38tca1o5I9qhHU5/acjzgfYry5CTRY79n1TYQ5AJHA2XcAQF9fVHgc+lAHns7Q
QARdJz98RKBvPV+ZNZSq3PxKlQRVE2MsuQqWDmUKINYWMGAhlwg7wJkQUCZxK8qx
HDj1UXiNpWyXMoSIB0p4p16z4/PGqHeR7C6CTFga0A06q0iqJQYGNjhWmwSx7+vK
ZQUtQd+l588ya/e/ctyJ
=nl2Z
-END PGP SIGNATURE-

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



ManyToMany using through and limit_choices_to

2010-11-22 Thread Ferran
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

I've seen on the docs that is not possible to use limit_choices_to with
a ManyToMany relationship using intermediate tables with through parameter.

I need to have an "ordered" ManyToMany relationship, and i'm using an
intermediate table to achieve this, but i also need to ensure we can't
have more than 5 entries; can anybody help me to figure how can i solve
this out?

Thank you,
- -- 
Abordemos el parlamento! -- http://pirata.cat
En democracia, dos Belén Esteban valen más que tú
Di NO al top-posting!
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJM6mfZAAoJEAWOKfEESaOwE6AQAIW9nnGciPk3hsuwkLH8NAtC
6DSZ7d3MM7akxrw8fOezAZKf0vbUyFP2wkVmuPXrpr/fYEMUIlC6PWb8NaSfiDlI
ywhX3ao0ZJIjw/Y3rjrYWmX5Yn9Tg9Fx9HXAo+sCsFY0JwE3oBWk7rNhVce1UZwu
p6yK5WRe0kEX3SZT81nb0XGyQNUZaW27xQ9FTEIMKbKLEB5r1HoMqsagASuQXCH5
OUVsoRI33dRhkxM1blpZYDbZSZFArHd9QEmTEy2wu6f++0GUKNrRDoJqZbbHSBTD
6zd7bIdmmNia5aILbOWWLkjCm5mO70i2a3w8s4jlNYsjhe1KmOUUWyDkzWSKmMlD
uSzP6u7RtbnwFatwZ4fBA8Xeq5b+Cok4aADN18sEB1XiSX1LOEbREoeBSs/WvBZ+
jxTC14HI9S53AU9PAjdMYhZHe5DFAcAy7LJphjWHS3WXesM8sXYDiCzcebFCkU29
WnN6lt8ef9tugCAhyjnCzi77gGT5+WIBLhaHEhpF/b7X3rds+vxiUYDBZiakQG07
BKuUuERpPPy9o/dUFjcXrWcAIbu07wc191Wolou1NGx4RtbKjO8oohuzzlHYsWs2
/L1aB8sPENUUC3XGRoD2Cq49ugBsYxjm1NBZL9eayyrXkY0DX9Ry0Xxw80AquHVk
KPjbSrxVkV6/puLVT32c
=uObP
-END PGP SIGNATURE-

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



Re: Problem using Proxy DB

2010-10-18 Thread Ferran

 On 18/10/10 15:56, Tom Evans wrote:

Don't put your router code in with your models, and you will avoid
this circular import issue. Create a new module with no other
dependencies and put your router code in there.

Thank you, Tom.

I was turning crazy! ;)

--
Abordemos el parlamento! -- http://pirata.cat
En democracia, dos Belén Esteban valen más que tú
Di NO al top-posting!

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



Problem using Proxy DB

2010-10-18 Thread Ferran
Hello all;

I'm just learning Django and i'm trying to get proxy db managers
working, but i can't manage to get it working. I've read the docs and
tried to search on google, but it seems unuseful.

Can anybody help me?

I'm attaching the error and my code.

setting.py:

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'intranet.db',
},
'viejuna': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'gestio_sl_utf8',
'USER': 'webadmin',
'PASSWORD': '',
'HOST': '192.168.1.4',
'PORT': '',
}
}
DATABASE_ROUTERS = ['intranet.vieja.models.ProxyDB',]

vieja/models.py:

from django.db import models

class old_Dominis(models.Model):
id = models.IntegerField(primary_key=True)
nom = models.CharField(max_length=70)
extensio = models.CharField(max_length=20)
id_account = models.IntegerField()
years = models.SmallIntegerField()
creat = models.DateField()
expira = models.DateField()
redirec = models.BooleanField()
c1 = models.BooleanField()
c2 = models.BooleanField()
dns_type = models.SmallIntegerField()
lock = models.BooleanField()
pl = models.BooleanField()
titular = models.TextField()
contacte_admin = models.CharField(max_length=150)
id_c_f = models.IntegerField()
contacte_fac = models.TextField()
id_grup = models.IntegerField()
grup = models.CharField(max_length=200)
dns1 = models.CharField(max_length=150)
dns2 = models.CharField(max_length=150)
estat = models.CharField(max_length=50)
class Meta:
db_table = u'dominis_view2'
managed = False

class ProxyDB(object):
def db_for_read(self, model, **hints):
if model._meta.app_label == 'vieja':
return 'viejuna'
return 'default'

def db_for_write(self, model, **hints):
if model._meta.app_label == 'vieja':
return 'viejuna'
return 'default'

def allow_relation(self, obj1, obj2, **hints):
if obj1._meta.app_label == 'vieja' and obj2._meta.app_label ==
'vieja':
return True
elif obj1._state.db == 'default' and obj2._state.db ==
'default':
return True
return None

def allow_syncdb(self, db, model):
if db == 'viejuna':
return model._meta.app_label == 'vieja'
elif model._meta.app_label == 'vieja':
return False
return True

The Error:

$> dj validate
Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File "/usr/lib/python2.6/site-packages/django/core/management/
__init__.py", line 438, in execute_manager
utility.execute()
  File "/usr/lib/python2.6/site-packages/django/core/management/
__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.6/site-packages/django/core/management/
base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.6/site-packages/django/core/management/
base.py", line 209, in execute
translation.activate('en-us')
  File "/usr/lib/python2.6/site-packages/django/utils/translation/
__init__.py", line 66, in activate
return real_activate(language)
  File "/usr/lib/python2.6/site-packages/django/utils/functional.py",
line 55, in _curried
return _curried_func(*(args+moreargs), **dict(kwargs,
**morekwargs))
  File "/usr/lib/python2.6/site-packages/django/utils/translation/
__init__.py", line 36, in delayed_loader
return getattr(trans, real_name)(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/django/utils/translation/
trans_real.py", line 193, in activate
_active[currentThread()] = translation(language)
  File "/usr/lib/python2.6/site-packages/django/utils/translation/
trans_real.py", line 176, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/usr/lib/python2.6/site-packages/django/utils/translation/
trans_real.py", line 159, in _fetch
app = import_module(appname)
  File "/usr/lib/python2.6/site-packages/django/utils/importlib.py",
line 35, in import_module
__import__(name)
  File "/usr/lib/python2.6/site-packages/django/contrib/admin/
__init__.py", line 1, in 
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
  File "/usr/lib/python2.6/site-packages/django/contrib/admin/
helpers.py", line 1, in 
from django import forms
  File "/usr/lib/python2.6/site-packages/django/forms/__init__.py",
line 17, in 
from models import *
  File "/usr/lib/python2.6/site-packages/django/forms/models.py", line
6, in 
from django.db import connections
  File "/usr/lib/python2.6/site-packages/django/db/__init__.py", line
64, in 
router = ConnectionRouter(settings.DATABASE_ROUTERS)
  File "/usr/lib/python2.6/site-packages/django/db/utils.py", line
112, in __init__
raise ImproperlyConfigured('Error importing database router %s:
"%s"' % 

Re: django-mailer truncate my log file

2010-09-21 Thread ferran
Thanks to Rolando for he's answer
http://groups.google.com/group/django-es/browse_thread/thread/c2107f2b172eb0c0/6f5ffb8235326e56?show_docid=6f5ffb8235326e56


On Sep 17, 11:35 am, ferran <pinksh...@gmail.com> wrote:
> hello,
> I don't understand because django-mailer truncate my log file every
> time run cronjob for send email, this is my config in settings.py
> import logging
>
> LOGFILE = "site.log"
> logging.basicConfig(level=logging.DEBUG,
>                     format='%(asctime)s %(name)-12s %(levelname)-8s %
> (lineno)d %(message)s',
>                     datefmt='%a, %d %b %Y %H:%M:%S',
>                     filename=os.path.join(PROJECT_PATH, LOGFILE),
>                     filemode='w')
>
> and in models or view i use:
> import logging
> log = logging.getLogger("order.views")
> log.debug("hello")
>
> , any idea?
> thanks in advanced

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



gunicorn not print debug info as run_server command

2010-09-17 Thread ferran
Howto config gunicorn for view in the console debug info, as the same,
run_server command?

Thanks in advanced

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



django-mailer truncate my log file

2010-09-17 Thread ferran
hello,
I don't understand because django-mailer truncate my log file every
time run cronjob for send email, this is my config in settings.py
import logging

LOGFILE = "site.log"
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %
(lineno)d %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
filename=os.path.join(PROJECT_PATH, LOGFILE),
filemode='w')

and in models or view i use:
import logging
log = logging.getLogger("order.views")
log.debug("hello")

, any idea?
thanks in advanced

-- 
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: reversing url tag with viewname as variable in the context

2008-06-09 Thread ferran

Thanks Alex the path works for me!

On Jun 8, 11:11 am, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> There is the tickethttp://code.djangoproject.com/ticket/7049
>
> On Jun 8, 1:05 pm, ferran <[EMAIL PROTECTED]> wrote:
>
> > Thanks Alex for confirm my suspicions
>
> > IMHO this is a great feature for url tag, if anyone have a idea for
> > implement this functionality, (like a eval(context_var_viewname)) i
> > work in this
>
> > thnaks
>
> > On Jun 8, 10:54 am, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > > No. Built-in {% url %} tag doesn't support variable as view name. To
> > > solve this you can write your own url-like template tag with needed
> > > functionality. Or refactor you code to avoid using the view name as
> > > variable:)
>
> > > On Jun 8, 12:39 pm, ferran <[EMAIL PROTECTED]> wrote:
>
> > > > Hi all,
>
> > > > The tag {% url viewname args %} supports a context variable for
> > > > viewname?? i don't know how put a context variable in viewname,  any
> > > > suggestion??
>
> > > > Thanks in advance
--~--~-~--~~~---~--~~
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: reversing url tag with viewname as variable in the context

2008-06-08 Thread ferran

Thanks Alex for confirm my suspicions

IMHO this is a great feature for url tag, if anyone have a idea for
implement this functionality, (like a eval(context_var_viewname)) i
work in this

thnaks

On Jun 8, 10:54 am, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> No. Built-in {% url %} tag doesn't support variable as view name. To
> solve this you can write your own url-like template tag with needed
> functionality. Or refactor you code to avoid using the view name as
> variable:)
>
> On Jun 8, 12:39 pm, ferran <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > The tag {% url viewname args %} supports a context variable for
> > viewname?? i don't know how put a context variable in viewname,  any
> > suggestion??
>
> > Thanks in advance
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



reversing url tag with viewname as variable in the context

2008-06-08 Thread ferran

Hi all,

The tag {% url viewname args %} supports a context variable for
viewname?? i don't know how put a context variable in viewname,  any
suggestion??

Thanks in advance
--~--~-~--~~~---~--~~
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: i18n translation urls in templates

2007-09-22 Thread ferran

Hi Esau,

Thanks for reply my messages,

for do that:
{% if es_home_url_presentation %}
something
{% if en_home_url_presentation %}
something else

i'm before need  trans tag because "es_home_url_presentation" and
"en_home_url_presentation" are a i18n string's  for this tag, and
represents the named url's in urls.py

I think, can i extends url tag for use i18n before??

On Sep 22, 10:16 am, Esau Rodriguez <[EMAIL PROTECTED]> wrote:
> On Saturday 22 September 2007 08:51:11 ferran wrote:
>
> > Hi,
>
> > I'm trying translate url's in my templates but i don't know how, i'm
> > using tags url and trans
> > i'm try this
>
> > {% url trans "home_url_presentation" %}
> > {% url | trans "home_url_presentation" %}
> > but do not anything
>
> > in locale .po files:
> > /en/LC_MESSAGES/django.po
> > msgid "home_url_presentation"
> > msgstr "en_home_url_presentation"
>
> > /es/LC_MESSAGES/django.po
> > msgid "home_url_presentation"
> > msgstr "es_home_url_presentation"
>
> > in urls.py :
> > url(r'^presentation/$', 'direct_to_template', {'template':
> > 'home_presentation.html'}, name="en_home_url_presentation"),
> > url(r'^presentacion/$', 'direct_to_template', {'template':
> > 'home_presentation.html'}, name="es_home_url_presentation"),
>
> > and how i translate urls in templates with tag URL??
>
> > thanks in advance
> > Ferran Parra
>
> I see what you want to get but i'm not sure you can do it using your aproach.
> I probably try to write my own templatetag; however you may rather to use
>
> {% if es_home_url_presentation %}
> something
> {% if en_home_url_presentation %}
> something else
>
> --
> ==
> Esaú Rodríuez Sicilia
> Email1: [EMAIL PROTECTED]
> Email2: [EMAIL PROTECTED]
> IM1: [EMAIL PROTECTED]
> IM2: [EMAIL PROTECTED]
> IM3: [EMAIL PROTECTED]
> C/Callao de Lima 38 3ºizq 38002 S/C de Tenerife
> ==


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



i18n translation urls in templates

2007-09-22 Thread ferran

Hi,

I'm trying translate url's in my templates but i don't know how, i'm
using tags url and trans
i'm try this

{% url trans "home_url_presentation" %}
{% url | trans "home_url_presentation" %}
but do not anything

in locale .po files:
/en/LC_MESSAGES/django.po
msgid "home_url_presentation"
msgstr "en_home_url_presentation"

/es/LC_MESSAGES/django.po
msgid "home_url_presentation"
msgstr "es_home_url_presentation"

in urls.py :
url(r'^presentation/$', 'direct_to_template', {'template':
'home_presentation.html'}, name="en_home_url_presentation"),
url(r'^presentacion/$', 'direct_to_template', {'template':
'home_presentation.html'}, name="es_home_url_presentation"),

and how i translate urls in templates with tag URL??

thanks in advance
Ferran Parra


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