E-commerce package

2012-09-04 Thread Randa Hisham
Iam developing an e-commerce website,lookig for a good django package
any recommends?

-- 
Randa Hesham
Software Developer

Twitter:@ro0oraa 
FaceBook:Randa Hisham 

ٍ

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



Re: E-commerce package

2012-09-04 Thread zayatzz
http://satchmoproject.com/

On Tuesday, September 4, 2012 10:02:07 AM UTC+3, randa hisham wrote:
>
> Iam developing an e-commerce website,lookig for a good django package
> any recommends?
>
> -- 
> Randa Hesham
> Software Developer
>
> Twitter:@ro0oraa 
> FaceBook:Randa Hisham 
>
> ٍ
>
> 

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



Django admin, trying to do a custom search

2012-09-04 Thread Johie
I'm saving a JSON parsed string containing dxdiag information in a field 
and I need to search through this field in the admin interface. 
I override queryset function but I can't seem to get it to work. Does 
someone have any suggestions to what I am doing wrong?

I got 15 posts and when I search for example "windows xp" (with the ") i 
get "0 results (13 total )", 
(I have checked and 13 of the 15 has windows xp in them) so it returns all 
values that contains my search term but nothing shows up in the change_list 
page.

Code:

class AdminUserData(admin.ModelAdmin):
   search_fields = ['games_played', 'dxdiag,]

  def queryset(self, request):
qs = super(AdminUserData, self).queryset(request)
print qs

if request.GET:   
query = request.GET.get('q')
data = query.split(' ')
begin = []
end = []

for item in data:
if item.startswith('"'):
begin.append(item[1:])

if item.endswith('"'):
end.append(item[:-1])

if len(begin) == 0 or len(end) == 0:
return qs

result = []
for i in xrange(0, len(begin)):
if begin[i][:-1] == end[i][1:]:
result.append(begin[i][:-1])
else:
result.append(begin[i] + ' ' + end[i])

print result

for i in xrange(0, len(result)):
print i
print result[i]
qs = qs.filter(dxdiag__icontains=result[i])

for item in qs:
print item
return qs

-- 
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/-/G4k3NxvM94UJ.
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: E-commerce package

2012-09-04 Thread Gladson Simplício Brito
http://www.merengueproject.org/

http://www.satchmoproject.com/

http://www.getlfs.com/

2012/9/4 Randa Hisham 

> Iam developing an e-commerce website,lookig for a good django package
> any recommends?
>
> --
> Randa Hesham
> Software Developer
>
> Twitter:@ro0oraa 
> FaceBook:Randa Hisham 
>
> ٍ
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



mod_python doesn't work propoerly

2012-09-04 Thread Maheshakya Wijewardena
I want to use django with apache server, but it needs mon_python

I've been trying to install mod_python ( 
mod_python-3.3.1.win32-py2.5-Apache2.2_2.exe 
), but the following errors occur during the installation
1. could not create mod_python-py2.5
2. could not set key value Python 2.5 mod_python-3.3.1
3. could not set key velue "C:\Python25\Removemod_python.exe" -u
"C:\Python25\mod_python-wininst.log"

I've the correct versions of python and apache installed in my system

After I'd updated the "httpd.conf" file with the statement "LoadModule 
python_module modules/mod_python.so" , apache server fails to restart.

what could be the reason?
 

-- 
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/-/p8W91LMg2AQJ.
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: Development server won't work from a shared web host

2012-09-04 Thread ecs1749
To answer my own question, I found the following:

http://www.andymboyle.com/django-tutorials/

On Monday, September 3, 2012 7:32:08 PM UTC-7, ecs1749 wrote:
>
> Thanks for the reply.  Yes, I saw that message.  I am a bit lost where to 
> go next if I completely ignore that tutorial regarding doing admin from the 
> development server (which I don't have).  Do I dive into tutorial   #3 and 
> hope that it will pick up the admin stuff later when it gets to talk about 
> wsgi?  Or is there a "here's what you do if you don't have a development 
> server" tutorial somewhere?
>
> On Monday, September 3, 2012 1:10:51 PM UTC-7, jondbaker wrote:
>>
>> In the 'Running the Development Server' section of this 
>> pagein the tutorial it states 
>> that:
>> "Although this server is convenient for development, resist the 
>> temptation to use it in anything resembling a production environment. The 
>> development server can handle only a single request at a time reliably, and 
>> it has not gone through a security audit of any sort."
>>
>> The 'runserver' command should only be used for local development. You 
>> need to configure your server to work with Django via wsgi (or a similar 
>> method).
>>
>> Jonathan
>>
>> On Mon, Sep 3, 2012 at 1:26 PM, ecs1749  wrote:
>>
>>> I have Django working from a shared host account (westhost).  I was able 
>>> to follow all of the steps in tutorials 1 & 2 except the part on starting 
>>> the development server.  Apparently westhost won't let you run that.  
>>> Without the development server, how do  I access the Django admin functions?
>>>
>>> Thanks,
>>>
>>> -- 
>>> 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/-/JUTvMucLwLYJ.
>>> 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.
>>>
>>
>>
>>
>> -- 
>> Jonathan D. Baker
>> Developer
>> http://jonathandbaker.com
>>
>>  

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



django-template-minimizer

2012-09-04 Thread Charles Kaminski
The django-template-minimizer project is a manage.py command to minimize 
your django templates after development. 

Instead of minimizing your html every time you serve it up, minimize your 
templates just once.

Please take a look at this beta project, try it out, and send me feedback 
on this thread or through git-hub:
https://github.com/Charles-Kaminski/django-template-minimizer

-Charles

-- 
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/-/a9Ldk-RpUmEJ.
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: E-commerce package

2012-09-04 Thread anthony tresontani

http://oscarcommerce.com/

On 04/09/12 09:27, zayatzz wrote:

http://satchmoproject.com/

On Tuesday, September 4, 2012 10:02:07 AM UTC+3, randa hisham wrote:

Iam developing an e-commerce website,lookig for a good django package
any recommends?

-- 
Randa Hesham

Software Developer

Twitter:@ro0oraa 
FaceBook:Randa Hisham 

ٍ

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

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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



Re: E-commerce package

2012-09-04 Thread Gour
On Tue, 4 Sep 2012 00:01:39 -0700
Randa Hisham  wrote:

> Iam developing an e-commerce website,lookig for a good django package
> any recommends?

Mezzanine & Cartridge - http://mezzanine.jupo.org/


Sincerely,
Gour

-- 
It is far better to discharge one's prescribed duties, even though 
faultily, than another's duties perfectly. Destruction in the course 
of performing one's own duty is better than engaging in another's
duties, for to follow another's path is dangerous.

http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


signature.asc
Description: PGP signature


Re: Javascript Image Hollover In Django

2012-09-04 Thread Amyth Arora
Here i created a step by step tutorial with explanations for you.

Enlarge Image on Hover -
jQuery

On Sat, Sep 1, 2012 at 3:25 AM, coded kid  wrote:

> When I followed your tutorial, the images were reshaped only and when I
> place my mouse on any of the thumbnail images it won't display the large
> image.  How can I go about it?
>
> On Friday, 31 August 2012 15:40:56 UTC+1, Amyth wrote:
>>
>> Hey,
>>
>> dun think this is really Django related, but still i created a jquery
>> example for you, check it http://jsfiddle.net/TjUtq/
>>
>> --
>> Thanks & Regards
>> 
>>
>> Amyth [Admin - Techstricks]
>> Email - aroras@gmail.com, ad...@techstricks.com
>> Twitter - @a_myth_
>> http://techstricks.com/
>>
>  --
> 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/-/5IGvhvxkSUsJ.
> 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.
>



-- 
Thanks & Regards


Amyth [Admin - Techstricks]
Email - aroras.offic...@gmail.com, ad...@techstricks.com
Twitter - @a_myth_
http://techstricks.com/

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



Re: Upload Image and pdf file

2012-09-04 Thread Dott. Tegagni Alessandro
The file settings.py is: http://dpaste.com/796111/

But the result is page not found, when i click on media file, that i upload.

any ideas?
Il giorno domenica 2 settembre 2012 15:53:48 UTC+2, Dott. Tegagni 
Alessandro ha scritto:
>
> The file urls.py is: http://dpaste.com/795211/
> If it is the help.
>
>
> Il giorno domenica 2 settembre 2012 14:51:21 UTC+2, Dott. Tegagni 
> Alessandro ha scritto:
>>
>> The folder is empty.
>>
>> Il giorno venerdì 31 agosto 2012 08:47:55 UTC+2, Amyth ha scritto:
>>>
>>> Do you actually see anyfiles uploaded under static/finale if you 
>>> manually browse the folder? or is it empty ?
>>>
>>> On Thu, Aug 30, 2012 at 7:54 PM, Dott. Tegagni Alessandro <
>>> tefar...@gmail.com> wrote:
>>>
 I have a project created with cms Django, and in this project i must 
 upload a image and pdf file. the code in models.py is as follow:
 http://dpaste.com/793672/

  
  
 The file with this step to upload, is inserted in correct folder, but 
 the file not work.

 In Administrator panel, when i click on image or pdf file, that i 
 uploaded, the browser tell me Page not found (404). The current URL, 
 home/alessandro/Scrivania/progetto/static/finale/header_blog.jpg, didn't 
 match any of these.

 I have verifed the permission, but i have in default chmod 777.

 Any ideas?

 I have follow also this tutorial youtube:Video From 
 YtI
  have the same code, but not result.

 Any Ideas? Where is my error?

 I can send the zip folder with the project, if you want.


 I try, also, edit the code of models.py in:
 http://dpaste.com/793673/


 but the error there is.Now, I think what I not write correctly the 
 configuration in settings.py. Media_Root, Media_Url, Static_Root, 
 Static_Url are empty. There parameters should not be empty, true? I 
 developer in localhost (on Linux/Ubuntu), web server Apache. What should i 
 write as configuration?

 With second link, the result is: The object albax with primary key 
 u'20/static/finale/Magic_green_bus_1.jpg' not exits.

 But the Image file, there is in correct file.

 Or the Problem is in urls.py, the code is: http://dpaste.com/793124/


 Any Ideas?



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

>>>
>>>
>>>
>>> -- 
>>> Thanks & Regards
>>> 
>>>
>>> Amyth [Admin - Techstricks]
>>> Email - aroras@gmail.com, ad...@techstricks.com
>>> Twitter - @a_myth_
>>> http://techstricks.com/
>>>
>>

-- 
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/-/XHPOp7wG3cIJ.
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: mod_python doesn't work propoerly

2012-09-04 Thread Tom Evans
On Tue, Sep 4, 2012 at 8:06 AM, Maheshakya Wijewardena
 wrote:
> I want to use django with apache server, but it needs mon_python
>
> I've been trying to install mod_python (
> mod_python-3.3.1.win32-py2.5-Apache2.2_2.exe ), but the following errors
> occur during the installation
> 1. could not create mod_python-py2.5
> 2. could not set key value Python 2.5 mod_python-3.3.1
> 3. could not set key velue "C:\Python25\Removemod_python.exe" -u
> "C:\Python25\mod_python-wininst.log"
>
> I've the correct versions of python and apache installed in my system
>
> After I'd updated the "httpd.conf" file with the statement "LoadModule
> python_module modules/mod_python.so" , apache server fails to restart.
>
> what could be the reason?
>

Never use mod_python for any reason, it is deprecated, undeveloped and
the wrong approach. mod_wsgi or mod_fastcgi are recommended,
instructions on how to use either of them are in the Django
documentation.

Cheers

Tom

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



Re: Is the logic in my model correct? Best-case?

2012-09-04 Thread Barry Morrison
That's exactly what I needed.  Thank you *very* much!

On Mon, Sep 3, 2012 at 8:44 PM, Dennis Lee Bieber wrote:

> On Mon, 3 Sep 2012 18:51:45 -0700 (PDT), Barry Morrison
>  declaimed the following in
> gmane.comp.python.django.user:
>
> > Model: http://dpaste.org/dqwmc/
> >
> > There can be many products.
>
> Okay, a table of products...
>
> > There can be many distributors.
>
> and a table of distributors
>
> > A product could have none or more distributors.
>
> Normal intersect table behavior
>
> > A distributor could only distribute a single product once.
>
> This clause is unclear...
>
> > A distributor could distribute all products.
> >
>
> This clause is irrelevant -- it doesn't restrict the data (vs if
> you
> had some requirement that a distributor carrying products a..m is not
> allowed to carry product n)
>
> > I imagine a form (admin side):
> >
> > Product Name:
> > Product Description:
> > Product Image:
> >
> > Distributor 1: Radio Field/Boolean
> > Distributor 2: Radio Field/Boolean
> > Etc. etc.
> >
> > For some reason I can't wrap my head around this.
>
> Your model (per the linked web page) current ties a product
> instance
> to ONE DISTRIBUTOR ONLY.
>
> In pseudo-SQL, you have defined
>
> create table Distributor
> (
> ID  integer autoincrement primary key,  #django adds this
> Namevarchar(255) not null,  #it is redundant to preface fields
>
> #with "distributor" when they are
>
> #IN the table Distributor
> URL varchar(255) null,  #URL type is django
> operation
> Product boolean #this field is meaningless as
>
> #there is no product referenced
>
> #here
> );
>
> create table Product
> (
> ID  integer autoincrement primary key,
> Namevarchar(255) not null,
> Description blob,   #or some such large text field
> Image   varchar(255) null,  #image type is django usage
> Distributor integer foreign key references Distributor (ID),
> #this basically says that this product can have
> #only ONE distributor
> );
>
> What you really need is not a one-to-many link (one distributor can
> have many products, but each product can only have one distributor) but
> a many-to-many linkage.
>
> create table Distributor
> (
> ID  integer autoincrement primary key,  #django adds this
> Namevarchar(255) not null,
> URL varchar(255) null,
> );
>
> create table Product
> (
> ID  integer autoincrement primary key,
> Namevarchar(255) not null,
> Description blob,   #or some such large text field
> Image   varchar(255) null,  #image type is django usage
> );
>
> create table ProductDistribution
> (
> ID  integer autoincrement primary key,
> ProductID   integer foreign key references Product(ID),
> DistributorID   integer foreign key references Distributor(I),
> unique (ProductID, DistributorID)
> );
>
> As I understand it, Django will create the equivalent of
> ProductDistribution when you declare a many-to-many relationship in one
> of the parent tables.
>
> --
> Wulfraed Dennis Lee Bieber AF6VN
> wlfr...@ix.netcom.comHTTP://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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Installation script?

2012-09-04 Thread Carsten Agger

Den 03-09-2012 16:07, Andres Reyes Monge skrev:

Take a look at this project https://github.com/dcramer/logan



Thanks a lot, but I'm afraid that's not quite what I'm looking for.

It seems logan is a tool for running Django instances as standalone 
program. What I'm looking for is a standardized installation procedure 
which includes Apache and PostgreSQL setup so my Web service (which is 
not really "standalone") is installed without the user having to 
configure a lot.





--
Carsten Agger
Magenta ApS
Åbogade 15
8200 Århus N

Tlf +45 5060 1269
Mob +45 2086 5010
http://www.magenta-aps.dk
carst...@magenta-aps.dk

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



Choosing a JS framework to go together with Django

2012-09-04 Thread dotnetCarpenter
Hi all.

I'm new here and just took over a Django project for the first time. I'm 
still getting to grip with Django but as a front end dev for the past 5 
years, I'm also looking for a client-side library/framework to go together 
with my project.
My requirements for a JS framework is that it:

   1. is unobtrusive (Django rendered HTML will be shown to scraper bots 
   like google)
   2. provides some sort of structure (MVC, MVP, MVVM ect.)
   3. embraces standards
   4. doesn't conflict with Django templates or does so intentionally
   5. ideally uses the same template language as Django

In the ideal world a request/response scenario would look like this:

   1. A client make a (HTTP) request to the (django powered) web site with 
   (HTTP) Accept header text/html
   2. Django response in the usual way by rendering the assign View (django 
   template)
   3. The view figure out if JS is supported (implemented in JS). If no, 
   this scenario stays in loop 1-3. If yes, then 4.
   4. The client (usually a browser) wire up the client-side app structure, 
   hook in to URI links, add transitions between views, data-bindings ect.
   5. Subsequent request are now handle by the JS framework, either user 
   initiated (e.g. clicking a link) or app initiated (e.g. pulling extra 
   data), that will modify the request header to Accept header 
   application/json or application/django-template.
   6. If django receive a request with an application/django-template 
   header it will serve the view as plain text. E.g. Content-type: text/plain. 
   On the other hand if django receive a request with application/json, it 
   will send the object model defined in the view as JSON.
   7. The client-side JS framework will receive a template to render in the 
   first request and the data to render in the template in the second request. 
   A promise object could be used to synchronize the two calls.

This way django will work as intended for non JS clients and silently 
convert to a RIA in clients that supports JS, with minimal double work for 
the two execution contexts.
A big pro in this is the fact that both django and the JS framework share 
template and data (only has to defined once - in django) - we'll duck type 
all the way. But does this JS framework exist? Does anyone have any 
experience with working with django and JS frameworks? Is there any obvious 
pitfalls in my ideal world scenario in regard to Django? And finally, is it 
possible to serve templates as plain text with django?
 

Cheers, Jon and thanks in advance

PS. I accidentally cross-posted this to the Django Developers group before 
realizing it was the wrong forum. Sorry about that. 

-- 
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/-/WrIx5DWqCVgJ.
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: Django Interview Questions

2012-09-04 Thread Stephen Anto
Hi Guys,

I have updated Django latest interview questions and 
answers. 
It may cover all technical requirements of the interview. 

Vist http://www.f2finterview.com/web/Django/ for latest Django interview 
questions and answers

On Monday, November 2, 2009 9:06:41 PM UTC+5:30, Dimitri Gnidash wrote:
>
> Hey guys, 
>
> For all those of you interviewing or being interviewed, I created a 
> quick list of sample interview questions. 
> While not comprehensive, it is a good start to review these before the 
> interview, if anything, to gain a perspective on how other people 
> might be using Django. 
>
>
> http://blog.lightsonsoftware.com/django-interview-questions-0 
>
>
> Dimitri Gnidash 
> www.lightsonsoftware.com

-- 
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/-/jubl3-wkwaUJ.
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: To Use or Not to Use the admin backend

2012-09-04 Thread Tomas Neme
> Anyway, to the question. Once the models, the intermediate models and
> the interactions between all of them start getting sufficiently
> complex, you will need to put new forms on front. Theoretically, you

I've a question about this. I tried to do something like this, but
using the main capabilities and hacking on the ModelAdmin classes,
changing the formsets and the like, and reusing as much as possible,
including of course the admin templates.

Of course, it wasn't possible. I was trying to do something as simple
as a double-indirection inline, a second-level foreign key, and ended
up just showing a link to the other model's admin page, creating,
indeed, a complex workflow where none was needed.

To what extent and how particularly would one need override a specific
admin page to do this kind of thing? Is reusing the templates at all
possible if you've customized things? Maybe the templates yes, but the
ModelAdmin views are impossible, I was in a hurry so I wasn't able to
do a good diagnosis of what would have been needed to do this.

Tomas

-- 
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

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



Re: Choosing a JS framework to go together with Django

2012-09-04 Thread Alec Taylor
AngularJS?

On Tue, Sep 4, 2012 at 11:39 PM, dotnetCarpenter
wrote:

> Hi all.
>
> I'm new here and just took over a Django project for the first time. I'm
> still getting to grip with Django but as a front end dev for the past 5
> years, I'm also looking for a client-side library/framework to go together
> with my project.
> My requirements for a JS framework is that it:
>
>1. is unobtrusive (Django rendered HTML will be shown to scraper bots
>like google)
>2. provides some sort of structure (MVC, MVP, MVVM ect.)
>3. embraces standards
>4. doesn't conflict with Django templates or does so intentionally
>5. ideally uses the same template language as Django
>
> In the ideal world a request/response scenario would look like this:
>
>1. A client make a (HTTP) request to the (django powered) web site
>with (HTTP) Accept header text/html
>2. Django response in the usual way by rendering the assign View
>(django template)
>3. The view figure out if JS is supported (implemented in JS). If no,
>this scenario stays in loop 1-3. If yes, then 4.
>4. The client (usually a browser) wire up the client-side app
>structure, hook in to URI links, add transitions between views,
>data-bindings ect.
>5. Subsequent request are now handle by the JS framework, either user
>initiated (e.g. clicking a link) or app initiated (e.g. pulling extra
>data), that will modify the request header to Accept header
>application/json or application/django-template.
>6. If django receive a request with an application/django-template
>header it will serve the view as plain text. E.g. Content-type: text/plain.
>On the other hand if django receive a request with application/json, it
>will send the object model defined in the view as JSON.
>7. The client-side JS framework will receive a template to render in
>the first request and the data to render in the template in the second
>request. A promise object could be used to synchronize the two calls.
>
> This way django will work as intended for non JS clients and silently
> convert to a RIA in clients that supports JS, with minimal double work for
> the two execution contexts.
> A big pro in this is the fact that both django and the JS framework share
> template and data (only has to defined once - in django) - we'll duck type
> all the way. But does this JS framework exist? Does anyone have any
> experience with working with django and JS frameworks? Is there any obvious
> pitfalls in my ideal world scenario in regard to Django? And finally, is it
> possible to serve templates as plain text with django?
>
>
> Cheers, Jon and thanks in advance
>
> PS. I accidentally cross-posted this to the Django Developers group before
> realizing it was the wrong forum. Sorry about that.
>
>  --
> 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/-/WrIx5DWqCVgJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Converting my Django app so that it uses one database: what approach to use for auth?

2012-09-04 Thread H. de Vries
Hey all,

At the moment I have a Django app that has multiple settings files and 
multiple databases for my customers. I run a separate Django instance for 
each customer. I'm going to put it all together in 1 database so that I can 
run it in one instance. This makes creating new customer accounts easier, 
for example.

Customers will visit domain.tld/customer_name/.

Now the company name gets passed as an argument to the view.

I want the user model to look like this:
user_id user_data ( all the normal fields ) company_id

So when the user logs in, Django has to retrieve the company_id for the 
current url and then when logging in authenticate this company_id against 
the user data.

How would one achieve this?


Thank you!

Regards,

Henk.

-- 
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/-/TWOD8anZ9oQJ.
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: Choosing a JS framework to go together with Django

2012-09-04 Thread Marcin Tustin
Why?

On Tue, Sep 4, 2012 at 10:23 AM, Alec Taylor  wrote:

> AngularJS?
>
>
> On Tue, Sep 4, 2012 at 11:39 PM, dotnetCarpenter  > wrote:
>
>> Hi all.
>>
>> I'm new here and just took over a Django project for the first time. I'm
>> still getting to grip with Django but as a front end dev for the past 5
>> years, I'm also looking for a client-side library/framework to go together
>> with my project.
>> My requirements for a JS framework is that it:
>>
>>1. is unobtrusive (Django rendered HTML will be shown to scraper bots
>>like google)
>>2. provides some sort of structure (MVC, MVP, MVVM ect.)
>>3. embraces standards
>>4. doesn't conflict with Django templates or does so intentionally
>>5. ideally uses the same template language as Django
>>
>> In the ideal world a request/response scenario would look like this:
>>
>>1. A client make a (HTTP) request to the (django powered) web site
>>with (HTTP) Accept header text/html
>>2. Django response in the usual way by rendering the assign View
>>(django template)
>>3. The view figure out if JS is supported (implemented in JS). If no,
>>this scenario stays in loop 1-3. If yes, then 4.
>>4. The client (usually a browser) wire up the client-side app
>>structure, hook in to URI links, add transitions between views,
>>data-bindings ect.
>>5. Subsequent request are now handle by the JS framework, either user
>>initiated (e.g. clicking a link) or app initiated (e.g. pulling extra
>>data), that will modify the request header to Accept header
>>application/json or application/django-template.
>>6. If django receive a request with an application/django-template
>>header it will serve the view as plain text. E.g. Content-type: 
>> text/plain.
>>On the other hand if django receive a request with application/json, it
>>will send the object model defined in the view as JSON.
>>7. The client-side JS framework will receive a template to render in
>>the first request and the data to render in the template in the second
>>request. A promise object could be used to synchronize the two calls.
>>
>> This way django will work as intended for non JS clients and silently
>> convert to a RIA in clients that supports JS, with minimal double work for
>> the two execution contexts.
>> A big pro in this is the fact that both django and the JS framework share
>> template and data (only has to defined once - in django) - we'll duck type
>> all the way. But does this JS framework exist? Does anyone have any
>> experience with working with django and JS frameworks? Is there any obvious
>> pitfalls in my ideal world scenario in regard to Django? And finally, is it
>> possible to serve templates as plain text with django?
>>
>>
>> Cheers, Jon and thanks in advance
>>
>> PS. I accidentally cross-posted this to the Django Developers group
>> before realizing it was the wrong forum. Sorry about that.
>>
>>  --
>> 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/-/WrIx5DWqCVgJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Marcin Tustin
Tel: +44 (0) 7773 787 105 (UK)
   +1  917 553 3974 (US)

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



Re: Choosing a JS framework to go together with Django

2012-09-04 Thread Alex Strickland

On 2012/09/04 03:39 PM, dotnetCarpenter wrote:


I'm new here and just took over a Django project for the first time. I'm
still getting to grip with Django but as a front end dev for the past 5
years, I'm also looking for a client-side library/framework to go
together with my project.


AngularJS from Google seems well thought of and is completely back-end 
agnostic as far as I can see.


I'm a n00b on client *and* server development so take it with a pinch of 
salt, but I have done quite a lot of reading.

--
Regards
Alex

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



Re: Choosing a JS framework to go together with Django

2012-09-04 Thread Peith Vergil
i've been playing with KnockoutJS lately. one thing i like about it is that
it's built-in templating engine has a different syntax than Django's, so
there shouldn't have any conflict.

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



Re: Choosing a JS framework to go together with Django

2012-09-04 Thread Rafael E. Ferrero
men, i use Jquery on www.expoferiasg.com.ar and works quite well.. with any
problem.

2012/9/4 Peith Vergil 

> i've been playing with KnockoutJS lately. one thing i like about it is
> that it's built-in templating engine has a different syntax than Django's,
> so there shouldn't have any conflict.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Rafael E. Ferrero
Claro: (03562) 15514856

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



Re: Choosing a JS framework to go together with Django

2012-09-04 Thread Paul Menzel
Dear Rafael,


Am Dienstag, den 04.09.2012, 11:55 -0300 schrieb Rafael E. Ferrero:
> men, i use Jquery on www.expoferiasg.com.ar and works quite well..
> with any problem.

s,with,without,?

Additionally your site does not tell my browser what character set it is
using and therefore all special signs are not displayed correctly in a
browser using UTF-8 by default.

And last but not least, though not so important on this list, plain text
messages are preferred on mailing lists [1]. ;-)


Thanks,

Paul


[1] http://en.opensuse.org/openSUSE:Mailing_list_netiquette


signature.asc
Description: This is a digitally signed message part


Re: Choosing a JS framework to go together with Django

2012-09-04 Thread Rafael E. Ferrero
Sorry paul... my bad... "without any problem" i mean.

extract of index.html:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml";>


 ...
do you see something wrong there, maybe a mistake??

2012/9/4 Paul Menzel 
>
> Dear Rafael,
>
>
> Am Dienstag, den 04.09.2012, 11:55 -0300 schrieb Rafael E. Ferrero:
> > men, i use Jquery on www.expoferiasg.com.ar and works quite well..
> > with any problem.
>
> s,with,without,?
>
> Additionally your site does not tell my browser what character set it is
> using and therefore all special signs are not displayed correctly in a
> browser using UTF-8 by default.
>
> And last but not least, though not so important on this list, plain text
> messages are preferred on mailing lists [1]. ;-)
>
>
> Thanks,
>
> Paul
>
>
> [1] http://en.opensuse.org/openSUSE:Mailing_list_netiquette




--
Rafael E. Ferrero
Claro: (03562) 15514856

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



Re: Choosing a JS framework to go together with Django

2012-09-04 Thread Paul Menzel
Am Dienstag, den 04.09.2012, 12:08 -0300 schrieb Rafael E. Ferrero:
> Sorry paul... my bad... "without any problem" i mean.
> 
> extract of index.html:
> 
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml";>
>   
>   
>  ...
> do you see something wrong there, maybe a mistake??

Strange. Loading it now worked without problems. Sorry for the noise,
although I think you should add two more »"« after html and before
utf-8.


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part


Re: Development server won't work from a shared web host

2012-09-04 Thread ecs1749
I don't have a local machine I can use to learn Django - just a personal 
acct from a shared host.  The question I kept asking was:  How do I get 
into admin and follow the tutorial without the development server because 
the tutorial doesn't tell me that.

Regards,

On Monday, September 3, 2012 11:13:53 PM UTC-7, Daniel Roseman wrote:
>
> On Tuesday, 4 September 2012 03:32:08 UTC+1, ecs1749 wrote:
>>
>> Thanks for the reply.  Yes, I saw that message.  I am a bit lost where to 
>> go next if I completely ignore that tutorial regarding doing admin from the 
>> development server (which I don't have).  Do I dive into tutorial   #3 and 
>> hope that it will pick up the admin stuff later when it gets to talk about 
>> wsgi?  Or is there a "here's what you do if you don't have a development 
>> server" tutorial somewhere?
>>
>>
> You should not be doing the tutorial - or any development - on your 
> server. Install Django locally and do it there, then deploy when you are 
> ready and not before.
>
> However, you are wrong to assume that the admin console has anything to do 
> with the development server - it works just fine with any server.
> --
> DR.
>

-- 
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/-/UhMFGZB6YS0J.
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: Choosing a JS framework to go together with Django

2012-09-04 Thread Melvyn Sopacua
Op 4 sep. 2012 16:38 schreef "Peith Vergil"  het
volgende:
>
> i've been playing with KnockoutJS lately.

+1 on knockout.

>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
> For more options, visit this

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



Re: Development server won't work from a shared web host

2012-09-04 Thread Marcin Tustin
You don't have a computer that you can develop on at all? How are you
writing this email? Developing over ssh is going to be a huge pain.

Now, you *maybe* can use the runserver command - if you do add the --help
switch it will tell you how to run it to bind to a particular interface and
port. It maybe that you can bind it to a port on the localhost interface
(and then tunnel that over ssh), or you may be able to have your host
allocate you specific ports which you can use to run any kind of web server
you like.

While runserver shouldn't be used for production, I have used it to
diagnose specific problems in the production environment, which inevitably
will differ from development when using a shared host. This is, of course,
fairly insecure, and could even be illegal depending on your data
protection obligations.

On Tue, Sep 4, 2012 at 12:03 PM, ecs1749  wrote:

> I don't have a local machine I can use to learn Django - just a personal
> acct from a shared host.  The question I kept asking was:  How do I get
> into admin and follow the tutorial without the development server because
> the tutorial doesn't tell me that.
>
> Regards,
>
>
> On Monday, September 3, 2012 11:13:53 PM UTC-7, Daniel Roseman wrote:
>>
>> On Tuesday, 4 September 2012 03:32:08 UTC+1, ecs1749 wrote:
>>>
>>> Thanks for the reply.  Yes, I saw that message.  I am a bit lost where
>>> to go next if I completely ignore that tutorial regarding doing admin from
>>> the development server (which I don't have).  Do I dive into tutorial   #3
>>> and hope that it will pick up the admin stuff later when it gets to talk
>>> about wsgi?  Or is there a "here's what you do if you don't have a
>>> development server" tutorial somewhere?
>>>
>>>
>> You should not be doing the tutorial - or any development - on your
>> server. Install Django locally and do it there, then deploy when you are
>> ready and not before.
>>
>> However, you are wrong to assume that the admin console has anything to
>> do with the development server - it works just fine with any server.
>> --
>> DR.
>>
>  --
> 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/-/UhMFGZB6YS0J.
>
> 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.
>



-- 
Marcin Tustin
Tel: +44 (0) 7773 787 105 (UK)
   +1  917 553 3974 (US)

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



Re: Choosing a JS framework to go together with Django

2012-09-04 Thread Tom Evans
On Tue, Sep 4, 2012 at 4:48 PM, Paul Menzel  wrote:
> Am Dienstag, den 04.09.2012, 12:08 -0300 schrieb Rafael E. Ferrero:
>> Sorry paul... my bad... "without any problem" i mean.
>>
>> extract of index.html:
>>
>> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
>> http://www.w3.org/1999/xhtml";>
>>   
>>   
>>  ...
>> do you see something wrong there, maybe a mistake??
>
> Strange. Loading it now worked without problems. Sorry for the noise,
> although I think you should add two more »"« after html and before
> utf-8.
>

No, you really shouldn't:

http://www.w3.org/TR/1999/REC-html401-19991224/charset.html#spec-char-encoding

Cheers

Tom

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



Re: E-commerce package

2012-09-04 Thread ecs1749
Along that line, I have a need for a very simple ecommerce store that any 
of the existing packages (like oscommerce) can handle easily.  However, I 
have not been able to find one that supports subscription based membership 
access to multimedia contents.  Does anybody know if that's a function 
available with any of these Django based packages, or is it something that 
needs to be developed as an add-on function?

Thanks,


On Tuesday, September 4, 2012 12:42:52 AM UTC-7, Gour wrote:
>
> On Tue, 4 Sep 2012 00:01:39 -0700 
> Randa Hisham > wrote: 
>
> > Iam developing an e-commerce website,lookig for a good django package 
> > any recommends? 
>
> Mezzanine & Cartridge - http://mezzanine.jupo.org/ 
>
>
> Sincerely, 
> Gour 
>
> -- 
> It is far better to discharge one's prescribed duties, even though 
> faultily, than another's duties perfectly. Destruction in the course 
> of performing one's own duty is better than engaging in another's 
> duties, for to follow another's path is dangerous. 
>
> http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 
>

-- 
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/-/WZwDhr-v6jYJ.
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: Validating GB telephone numbers in Django forms.

2012-09-04 Thread g1smd.1
On Monday, September 3, 2012 8:10:46 PM UTC, g1smd.1 wrote:
>
> I see that there are routines for validating telephone numbers in forms in 
> Django for several countries.
>
> The code for that can usually be found in the forms.py file located in the 
> various country folders here:
> https://github.com/django/django/tree/master/django/contrib/localflavor 
>
> So far, there is nothing for GB numbers, here:
> https://github.com/django/django/tree/master/django/contrib/localflavor/gb
>
> I've written a bunch of RegEx patterns to get this functionality started. 
> The patterns are 100% fully tested. All that's needed is a few lines of 
> python logic to string them together. The details can be found at:
> https://github.com/django/django/pull/316/files
>
> My python foo is almost zero. Anyone care to have a go at getting this to 
> work?
>
> RegEx 1 checks the user entered something that looks like a GB telephone 
> number:
> 020  3000  
> 02075  567  234
> 0114  223  4567
> 01145  345  567
> +44  1213  456  789
> 00  44  (0)  1697  73555
> 011  44  11  4890  2345
> and several other formats, without worrying if the format is correct for 
> this particular number (but read on). It allows for national or 
> international format, even for two common international dial prefixes. What 
> is most important is that the user enters the right number of digits. Don't 
> constrain the user to use a particular format for entry.
> "Be lenient in what you accept, be strict in what you send." (Postel's Law)
>
> RegEx 2 extracts the NSN part of the number in $3, with "44" or NULL in $2 
> (so you know if international or national format was used on input), and 
> any extension in $4. Store $2 and $4 for later. Send $3 on to RegEx 3.
>
> RegEx 3 tests the NSN part of the number is in a valid range and has the 
> right number of digits for that range (GB numbers can be 9 or 10 digits 
> long). This RegEx pattern is very detailed. You can say that a number is 
> possible or is invalid with this RegEx.
>
> RegEx Group 4. Here, there's a bunch of RegEx patterns that specify how a 
> GB number should be formatted, detailed by number length and initial 
> digits. These rules cover all GB numbers.
>
> The last bit is to add the 0 or +44 back on, and append the original 
> extension number (if present) and present it back to the user.
>
> 020  3000   => Valid: 020  3000  
> 02075  567  234 => Valid: 020  7556  7234
> 0114  223  4567 => Valid: 0114  223  4567
> 01145  345  567 => Valid: 0114  534  5567
> +44  1213  456  789 => Valid: +44  121  345  6789
> 00  44  (0)  1697  73555 => Valid: +44  16977  3555
> 011  44  11  4890  2345 => Valid: +44  114  890  2345
> 0623 111 3456 => NOT VALID
>
>
>

This is now also filed as ticket #18903 at 
https://code.djangoproject.com/ticket/18903




-- 
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/-/K9lpBp_pfUMJ.
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: Installation script?

2012-09-04 Thread creecode
Hello Cartsten,

Have you checked out pip  which has 
a requirements feature and fabric .  Those two 
would probably take you a fair ways or at least give you some ideas how you 
might approach the problem.

On Monday, September 3, 2012 5:39:41 AM UTC-7, Carsten Agger wrote:
 

> We'd like to be able to automate all of this, so that the user can 
> install these two services by running a single installation script.
>

Toodle-looo
creecode

-- 
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/-/POj4TfIrtHUJ.
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: To Use or Not to Use the admin backend

2012-09-04 Thread Carlos Daniel Ruvalcaba Valenzuela
Funny thing, this same question was asked a few years ago, the answare
was that the admin was flexible enough for anything and the preferred
way, only as last resort you would need to roll your own.

https://groups.google.com/d/topic/django-users/BwhAa_nJSAc/discussion

I'm still on the side of rolling your own.

Regards,
Carlos Daniel Ruvalcaba Valenzuela

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



Output of form in Extjs

2012-09-04 Thread JJ
Hi all,
I created parse django to extjs in modelforms and forms. Basically works as 
form.as_p but is form.extjs_output. I mapped all widgets fields to extjs. I 
would like to submit this code to django-project. What do you think?
Thank you.

João Júnior

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



messages.sucess question

2012-09-04 Thread Steven Elliott
Hello,

Is there an easy way to not display a success message as an unordered list? 
I have been looking high and low and for some reason cannot find an answer 
to this. Thank you!

Best,
Steven Elliott

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



Re: Using the CSRF token with two views

2012-09-04 Thread Bill Freeman
Of course, JavaScript will be involved.  You can probably get the token
from the cookies, but you could also add code to your (first) template
to set a JS variable to the token.  Then, when you (on the client side)
get the form to display, you can insert the appropriate hidden element.

Bill

On Sun, Sep 2, 2012 at 5:06 PM, Robert Steckroth
 wrote:
> No actually the the template that renders the form is separate from
> the template that submits it.
> It is working with a @csrf_exempt on the processing view however. I
> guess I need a way to inform form processing view
> of the token it was given in the form serving view. I should be able
> to provide this with a caching or session variable.
> It was a pain in the rear, but the result is very professional. I am
> just gonna ignore it for now until it goes public.
>
>
> On Sun, Sep 2, 2012 at 1:16 AM, Melvyn Sopacua  wrote:
>> On 2-9-2012 0:52, Robert Steckroth wrote:
>>
>>> The
>>> problem is that the contact form
>>> is provided by one view and processed by another. This, of course
>>> raises a CSRF token error in the posting
>>> submit.
>> I don't see the logic of this, unless by view you mean request. This is
>> also a bit confusing:
>>>  I have created a dynamic template loading system utilizing
>>> ajax inside the template.
>>
>> If by template you mean django template, then the above can not ever be
>> created. AJAX is incapable of generating server side code by design.
>> What is more likely, is that your template generates javascript that
>> fetches bits of HTML using other urls, that are then coupled to other
>> django templates and this gives a similar end result in which a page
>> consists of dynamic blocks akin to django's {% include %} tag.
>>
>> However, the execution flow is still that django provides the content
>> for the browser, so the contact form can have it's own CSRF token. Are
>> you providing that token in the template that renders the contact form?
>> --
>> Melvyn Sopacua
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Bust0ut, Surgemcgee: Systems Engineer ---
> surgemcgee.com
> BudTVNetwork.com
> RadioWeedShow.com
> "Bringing entertainment to Unix"
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Choosing a JS framework to go together with Django

2012-09-04 Thread Paul Menzel
Am Dienstag, den 04.09.2012, 17:37 +0100 schrieb Tom Evans:
> On Tue, Sep 4, 2012 at 4:48 PM, Paul Menzel  wrote:
> > Am Dienstag, den 04.09.2012, 12:08 -0300 schrieb Rafael E. Ferrero:
> >> Sorry paul... my bad... "without any problem" i mean.
> >>
> >> extract of index.html:
> >>
> >>  >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> >> http://www.w3.org/1999/xhtml";>
> >>   
> >>   
> >>  ...
> >> do you see something wrong there, maybe a mistake??
> >
> > Strange. Loading it now worked without problems. Sorry for the noise,
> > although I think you should add two more »"« after html and before
> > utf-8.
> 
> No, you really shouldn't:
> 
> http://www.w3.org/TR/1999/REC-html401-19991224/charset.html#spec-char-encoding

Right. Thanks, I should have checked before suggesting something.


I will shut up now and keep wondering why Midori did not display it
correctly the first time I viewed the page.


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part


Re: 'str' object is not callable in base.py

2012-09-04 Thread Bill Freeman
My best guess is that, for whatever reason, 'timetable_view' in your url conf
has not been converted into the view function.  Try actually importing the
view in urls.py and putting it as the target of the pattern *without*
the quotes.
If this works, then figuring out whether you needed 'app_name.timetable_view'
or some such is where to look.  If it still doesn't work, you may get additional
insights (can you actually import views.py, or does it have a syntax
error, etc.).

On Tue, Sep 4, 2012 at 2:06 AM, zayatzz  wrote:
> From this post i can see this line beeing wrong .
>
> timetable = get_object_or_404(slug=slug)
>
> You also need to give object as one of the parameters for get_object_or_404
> shortcut: like this :
> https://docs.djangoproject.com/en/dev/intro/tutorial03/?from=olddocs#a-shortcut-get-object-or-404
>
> Alan
>
>
> On Tuesday, September 4, 2012 7:30:22 AM UTC+3, Lachlan Musicman wrote:
>>
>> Hi all,
>>
>> Stumped on this one:
>>
>>
>> Traceback:
>>
>> Environment:
>>
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/tafe/timetable/2012-4/
>>
>> Django Version: 1.4
>> Python Version: 2.7.3
>> Installed Applications:
>> ('django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.sites',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'django.contrib.admin',
>>  'tafe',
>>  'south',
>>  'crispy_forms')
>> Installed Middleware:
>> ('django.middleware.common.CommonMiddleware',
>>  'django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.csrf.CsrfViewMiddleware',
>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>  'django.contrib.messages.middleware.MessageMiddleware')
>>
>> Traceback:
>> File
>> "/home/datakid/src/envs/mlhrd/local/lib/python2.7/site-packages/django/core/handlers/base.py"
>> in get_response
>>   111. response = callback(request,
>> *callback_args, **callback_kwargs)
>>
>> Exception Type: TypeError at /tafe/timetable/2012-4/
>> Exception Value: 'str' object is not callable
>>
>> urls.py:
>> ...
>>   url(r'^timetable/(?P[-\w]+)/$', 'timetable_view'),
>> ...
>>
>> views.py:
>> @login_required
>> def timetable_view(request, slug):
>> timetable = get_object_or_404(slug=slug)
>> sessions = timetable.sessions.all()
>> return
>> render_to_response('tafe/timetable_detail.html',{'timetable':timetable,'sessions':sessions})
>>
>> models.py:
>>
>> class Session(models.Model):
>>...
>>timetable = models.ForeignKey(Timetable, related_name='sessions')
>>...
>>
>> What am I doing wrong?
>>
>> cheers
>> L.
>
> --
> 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/-/gEKT5Z85E14J.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

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



New project: Planning for the future

2012-09-04 Thread Tom Eastman
Hey guys,

I'm about to embark on a reasonably ambitious Django project that might
need to be maintained for some time into the future. I'm interested in
making the best choices *now* to minimize future pain.

So I'm interested in peoples' experiences and maybe even regrets. What
sort of things do you wish you had decided in early stages that would
have made your life a lot easier?

Some thoughts I'm already having:

- Components: Django, apache, mod-wsgi, memcached, postgres

- My intent is to keep it as horizontally scalable as possible -- I want
to make it easy to simply throw more servers at the system when load
gets high.

- I might need a distributed task queue -- I haven't used one before
myself but I've heard about celery, any suggestions?

- It's a fairly tightly integrated system so I'll keep a central
TEMPLATES and STATIC folder, rather than wanting them per-app.

- test-driven development and an integration test suite are project
requirements. I've used Selenium in the past, but since I'm starting
fresh should I use a newer technology, like PhantomJS?  What about for
the test suite? nose?

- Deciding on how I want to do deployment might be the decision with the
most obvious long-term consequences. I've used setup.py and buildout in
the past, my sysadmin team would far prefer everything comes in nicely
packaged .debs, there's a lot of options, and all of them are fiddly. I
would really appreciate people's thoughts on this.

- Writing future-proof code: I will be writing in Python 2.7, but I want
to remain as future-compatible to Python 3 as possible. How do I go
about achieving this? Some combination of using "from future import
[whatever]" and a compatibility library like 'six'? I've only heard of
'six', I'm yet to use it. The simple fact is that Python 3 is the
'future', but it's not the 'present', at least until Django and 3rd
party libraries are all ready for it.


If you have an opinion on any or many of the above, don't be afraid to
shout out! It might be an interesting discussion.

Cheers!

Tom


-- 
  Tom Eastman  //  Catalyst IT Ltd.  //  +64 4 803 2432



signature.asc
Description: OpenPGP digital signature


Re: To Use or Not to Use the admin backend

2012-09-04 Thread Lachlan Musicman
On Wed, Sep 5, 2012 at 1:50 AM, Tomas Neme  wrote:
> I've a question about this. I tried to do something like this, but
> using the main capabilities and hacking on the ModelAdmin classes,
> changing the formsets and the like, and reusing as much as possible,
> including of course the admin templates.
>
> Of course, it wasn't possible. I was trying to do something as simple
> as a double-indirection inline, a second-level foreign key, and ended
> up just showing a link to the other model's admin page, creating,
> indeed, a complex workflow where none was needed.
>
> To what extent and how particularly would one need override a specific
> admin page to do this kind of thing? Is reusing the templates at all
> possible if you've customized things? Maybe the templates yes, but the
> ModelAdmin views are impossible, I was in a hurry so I wasn't able to
> do a good diagnosis of what would have been needed to do this.

I don't know either mate - I'm going to have to learn, and probably by
trial and error - there's not a lot of good documentation about this
use case or this need. I presume it's like the man pages, or Deleuze
and Guattari - impregnable to the neophyte, but once you no longer
really need them, they make sense. Is ok, here comes learning!

cheers
L.

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



with/include template pattern? seeking best practices

2012-09-04 Thread Ivan Kirigin
I find myself writing things like this a lot in django templates

{% for e in some_list %}
{% with e as element %}
{% include "single_element.html" %}
{% endwith %} 
{% enfor %}

This would be in a template which shows a lists of elements, with another 
template that renders a single one. The template single_element.html uses 
element locally. I find this encapsulates my templates well, especially in 
making single_element.html far more reusable.

I've been doing this for a while and wanted to know if there is a better 
way I just don't know about. Also, I don't know the performance 
implications of so many with/include calls. This list could be very long 
(100s or 1000s).

Thanks!
Ivan Kirigin
http://kirigin.com

-- 
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/-/48yhZIb9P9MJ.
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: Form field with suggestions rather than binding choices

2012-09-04 Thread Vikas Rawal

>
> > I want to have a field in which the drop-down menu lists some 
> > suggestions that the user may choose from, or if nothing suits, the 
> > user may enter something other than what is available on the menu. 
>
> I think you should use a properly modified autocomplete solution. 
> https://code.djangoproject.com/wiki/AutoCompleteSolutions 
>

Thanks.

Vikas 

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



Does ``QuerySet.select_for_update`` lock related (joined) rows as well?

2012-09-04 Thread Yo-Yo Ma
restaurant = 
Restaurant.objects.select_for_update().select_related('owner').get(name=u'Koala 
Kafe')

Assuming the ``owner`` field points to a ``Person`` table, will the 
aforementioned query prevent the ``Person`` row returned for the Koala 
Kafe's owner from being saved in a separate transaction?

(I will be using Postgres and using ``transaction.commit_on_success``)

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



Django multitenant urls configuration

2012-09-04 Thread Oak
Hello everrybody! 

I am trying to add some simple tenancy support to an app, creating an Account 
model which has a string 'tenant' to be read from the request url and identify 
the tenant in the system:

tenant.example.com/* -> www.example.com/tenant/* (rewritten by apache)

I wrote a simple middleware to capture this /tenant/ from request.path and add 
a request.account object to be worked with.

My problem is my url mapping.

I tried this:

url(r'^(?P[\w\-]+)/', include('project.urls_tenant')),
and defined some simple urls inside urls_tenant.py:

url(r'^app1/', include('project.app1.urls')),

url(r'^app2/', include('project.app2.urls')),
When I try to access any page, I get an error message:

generic_view_method() got an unexpected keyword argument 'tenant_id'

because it doesn't (and really shouldn't) expect tenant_id as a parameter.

If I hardcode tenant_id in the urls.py file as /test_tenant/ everything works 
fine.

What am I doing wrong and how to fix it, so the request and the response gets 
processed normally?

Thank you guys pretty much. I used this as reference: optimal architecture for 
multitenant application on django: 
http://stackoverflow.com/questions/7194341/optimal-architecture-for-multitenant-application-on-django

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



Django Role in San Francisco

2012-09-04 Thread Tim
I work for AppDynamics, www.appdynamics.com, a tools monitoring company 
that is looking for a Sr. SWE/Principal Engineer with strong Django and 
Java exp.  My email is tstaff...@appdynamics.com to hear more.

-- 
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/-/Mkd4nVmkqIIJ.
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: 'str' object is not callable in base.py

2012-09-04 Thread Lachlan Musicman
On Tuesday, September 4, 2012, zayatzz wrote:

> From this post i can see this line beeing wrong .
>
> timetable = get_object_or_404(slug=slug)
>
> You also need to give object as one of the parameters for
> get_object_or_404 shortcut: like this :
>
> https://docs.djangoproject.com/en/dev/intro/tutorial03/?from=olddocs#a-shortcut-get-object-or-404
>

Thankyou for pointing this out - it was indeed wrong and has now been
fixed. Unfortunately, it didn't solve the problem.

cheers
L.

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



Re: Editable Tables

2012-09-04 Thread MattDale
Try DHTMLX Grid.  I use it solely for the editable grid feature. It took a 
little while to style it so it fits with my site, but as far as simple AJAX 
editable grids, I couldn't find an better one.

On Saturday, September 1, 2012 5:58:25 PM UTC-4, Sait Maraşlıoğlu wrote:
>
> Just seen a demo page
> http://nextgensim.info/grids
> so beautiful grids,
> lift framework can do that, I guess, havent dig much but as far as I seen, 
> its an alternative framework.
> Can anybody tell me how to create this kind of interactive tables? What 
> django has to offer, if not What keywords, I need to search?
> thx
>

-- 
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/-/T-kwZS0sC80J.
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: 'str' object is not callable in base.py

2012-09-04 Thread Lachlan Musicman
On Wednesday, September 5, 2012, Bill Freeman wrote:

> My best guess is that, for whatever reason, 'timetable_view' in your url
> conf
> has not been converted into the view function.  Try actually importing the
> view in urls.py and putting it as the target of the pattern *without*
> the quotes.
> If this works, then figuring out whether you needed
> 'app_name.timetable_view'
> or some such is where to look.  If it still doesn't work, you may get
> additional
> insights (can you actually import views.py, or does it have a syntax
> error, etc.).


Yes, this was the answer - thanks Bill.

I tried tafe.timetable_view and it didn't work, so I tried

from tafe.views import timetable_view

and it did...

then I realised I needed

'tafe*.views.*.timetable_view'
 as the pattern target.

Thanks for your help
L.

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



Re: Editable Tables

2012-09-04 Thread m1chael
clever!!

On Mon, Sep 3, 2012 at 8:20 AM, zayatzz  wrote:

> For this kind of thing django has forms and formsets. I would think that
> this can be achieved quite easyly by using formsets. What you can do  - you
> can write your own widgets for this kind of table. Like widget that renders
> value
> not just input. and then just use your javascript to bind click event to
> td.span which hides span and makes input visible on click. quite easy even.
> At save it saves everything and voila - you have editable table.
>
> everything else is just browser side scripting.
>
> thats how i would do it anyway :)
>
> Alan
>
>
> On Sunday, September 2, 2012 10:13:17 PM UTC+3, Sait Maraşlıoğlu wrote:
>>
>> Just need to display tables, but it has to be modular.
>> Lets say I have a facebook like site, and my user has 5 friends. How I
>> can display those 5 and let user edit it, lets say, edit their nicknames
>> and this changes affect the database?
>>
>> On Sunday, 2 September 2012 00:58:25 UTC+3, Sait Maraşlıoğlu wrote:
>>>
>>> Just seen a demo page
>>> http://nextgensim.info/grids
>>> so beautiful grids,
>>> lift framework can do that, I guess, havent dig much but as far as I
>>> seen, its an alternative framework.
>>> Can anybody tell me how to create this kind of interactive tables? What
>>> django has to offer, if not What keywords, I need to search?
>>> thx
>>>
>>  --
> 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/-/au7eeELCSVoJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Using the CSRF token with two views

2012-09-04 Thread Robert Steckroth
Ya, that sounds like the way to go, thank you. The project is shaping
up nicely, but
you both were right about the JavaScript. I am thinking on
a Django parsing view to do preliminary regex matching. Right now
it is in the handled by the client with a 1-2 second delay/loading time.
It looks incredibly professional though.

On Tue, Sep 4, 2012 at 4:29 PM, Bill Freeman  wrote:
> Of course, JavaScript will be involved.  You can probably get the token
> from the cookies, but you could also add code to your (first) template
> to set a JS variable to the token.  Then, when you (on the client side)
> get the form to display, you can insert the appropriate hidden element.
>
> Bill
>
> On Sun, Sep 2, 2012 at 5:06 PM, Robert Steckroth
>  wrote:
>> No actually the the template that renders the form is separate from
>> the template that submits it.
>> It is working with a @csrf_exempt on the processing view however. I
>> guess I need a way to inform form processing view
>> of the token it was given in the form serving view. I should be able
>> to provide this with a caching or session variable.
>> It was a pain in the rear, but the result is very professional. I am
>> just gonna ignore it for now until it goes public.
>>
>>
>> On Sun, Sep 2, 2012 at 1:16 AM, Melvyn Sopacua  wrote:
>>> On 2-9-2012 0:52, Robert Steckroth wrote:
>>>
 The
 problem is that the contact form
 is provided by one view and processed by another. This, of course
 raises a CSRF token error in the posting
 submit.
>>> I don't see the logic of this, unless by view you mean request. This is
>>> also a bit confusing:
  I have created a dynamic template loading system utilizing
 ajax inside the template.
>>>
>>> If by template you mean django template, then the above can not ever be
>>> created. AJAX is incapable of generating server side code by design.
>>> What is more likely, is that your template generates javascript that
>>> fetches bits of HTML using other urls, that are then coupled to other
>>> django templates and this gives a similar end result in which a page
>>> consists of dynamic blocks akin to django's {% include %} tag.
>>>
>>> However, the execution flow is still that django provides the content
>>> for the browser, so the contact form can have it's own CSRF token. Are
>>> you providing that token in the template that renders the contact form?
>>> --
>>> Melvyn Sopacua
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>>
>> --
>> Bust0ut, Surgemcgee: Systems Engineer ---
>> surgemcgee.com
>> BudTVNetwork.com
>> RadioWeedShow.com
>> "Bringing entertainment to Unix"
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Bust0ut, Surgemcgee: Systems Engineer ---
surgemcgee.com
BudTVNetwork.com
RadioWeedShow.com
"Bringing entertainment to Unix"

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



Re: What does this code do? Also, testing decorator via terminal?

2012-09-04 Thread Micky Hulse
On Sat, Sep 1, 2012 at 10:47 PM, Melvyn Sopacua  wrote:
> More precise, if it's an object instance that has HttpResponse as a
> class in it's inheritance chain.
> 

Thanks Melvyn! I really appreciate the help and description/clarification. :)

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



Re: Django + FAPWS doesnt show the templates/view correct

2012-09-04 Thread keeran
 
 
Finally, I understood the solution is
 
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns += staticfiles_urlpatterns()
Thanks,
keeran

On Friday, August 17, 2012 3:13:00 PM UTC+5:30, keeran wrote:

> On the Django development server, django app works fine. But once I setup 
> the production test run, I get only the text contents, where template views 
> are not shown as intended. What am I going wrong? 
>
> I have django 1.5 latest.
>
>  Nginx - 0.8.54 
>
> uWSGI - 1.2.5
> Also tried FAPWS3.0 similar result;
>  
> cmd for uWSGI:
> =
> sudo uwsgi --ini test.ini
>  
>  
>
> test.ini content:
> ===
> [uwsgi]
> # set the http port
> http = :8080
> python_path = /home/test/Desktop/IT_mgmt/IT_mgmt/settings.py/
> # change to django project directory
> chdir = /home/test/Desktop/IT_mgmt
> # load django
> module = IT_mgmt.wsgi
>
>
> 
>  
>

-- 
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/-/NAtpcDxjOtYJ.
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: No ROLLBACK within TestCase on second database

2012-09-04 Thread Mike Dewhirst

On 5/09/2012 12:01pm, Kit Randel wrote:

Hi there,

I'm running into an issue on Django 1.2 where the second test in my test
suite fails due to a duplicate key value violation. It appears that the
issue is that calls to my 'default' db, test_app_django in this case,
run within a transaction, but those to my application db, test_app, do
not. You can see from the SQL log that only the default db has a
ROLLBACK, causing later tests to fail. Does anyone know how I can ensure
that interaction with my second db is also run within a transaction and
appropriately rolled back?


I asked about this a couple of weeks ago and the correct solution is to 
use a TransactionTestCase


https://groups.google.com/forum/?fromgroups=#!topic/django-users/RxzVIqQINq8

Mike




test_member_programme.py
--
from datetime import date, timedelta

from django.test import TestCase

from fred_db.test.factories import StudentFactory, ProgrammeFactory
from fred_db.models import StudentProgramme

class StudentProgrammeTestCase(TestCase):

 def setUp(self):
 self.stud_prg = self.student_programme()

 def tearDown(self):
 pass

 def student_programme(self):
 yesterday = date.today() - timedelta(days=1)
 return StudentProgramme.objects.create(
 stud=StudentFactory(),
 prgm=ProgrammeFactory(),
 date_registered=yesterday)

 def date_registered_should_be_defined_test(self):
 assert hasattr(self.stud_prg, 'date_registered')

 def date_registered_should_be_in_past_test(self):
 assert self.stud_prg.date_registered < date.today()
-

|dba test_app127.0.0.1  2012-09-04  21:51:50.806  UTC LOG:   duration:  0.038  
ms  statement:  BEGIN;  SET TRANSACTION ISOLATION LEVEL READ COMMITTED
dba test_app127.0.0.1
2012-09-04  21:51:50.808  UTC LOG:   duration:  0.903  ms  statement:  INSERT INTO"member_programme"  ("mem_id",  
"prgm_id",  "date_registered",  "date_completed",  "ordinality")  VALUES(1,  1,  E'2012-09-04',  
NULL,  1)
dba test_app127.0.0.1
2012-09-04  21:51:50.808  UTC LOG:   duration:  0.150  ms  statement:  SELECT 
CURRVAL(pg_get_serial_sequence('"member_programme"','id'))
dba test_app127.0.0.1
2012-09-04  21:51:50.810  UTC LOG:   duration:  1.796  ms  statement:  COMMIT
dba test_app_django127.0.0.1  2012-09-<
span class="lit" style="margin: 0px; padding: 0px; border: 0px; font-size: 14px; 
vertical-align: baseline; background-color: transparent; color: rgb(128, 0, 0); background-position: 
initial initial; background-repeat: initial initial; ">04  21:51:50.811  UTC LOG:   duration:  
0.056  ms  statement:  ROLLBACK<  ROLLBACK ON DJANGO DB ONLY
dba test_app_django127.0.0.1  2012-09-<
span class="lit" style="margin: 0px; padding: 0px; border: 0px; font-size: 14px; 
vertical-align: baseline; background-color: transparent; color: rgb(128, 0, 0); background-position: 
initial initial; background-repeat: initial initial; ">04  21:51:50.814  UTC LOG:   
disconnection:  session time:  0:00:21.005  user=dba database=test_app_django host=127.0.0.1  
port=60355
dba test_app127.0.0.1
2012-09-04  21:51:50.818  UTC LOG:   disconnection:  session time:  0:00:04.751 
 user=dba database=test_app host=127.0.0.1  port=60357
dba test_app127.0.0.1
2012-09-04  21:54:00.796  UTC LOG:   connection authorized:  user=dba 
database=test_app
dba test_app127.0.0.1
2012-09-04  21:54:00.802  UTC LOG:   duration:  0.243  ms  statement:  SET 
DATESTYLE TO'ISO'
dba test_app127.0.0.1
2012-09-04  21:54:00.802  UTC LOG:   duration:  0.156  ms  statement:  SHOW 
client_encoding
dba test_app127.0.0.1
2012-09-04  21:54:00.803  UTC LOG:   duration:  0.047  ms  statement:  SHOW 
default_transaction_isolation
dba test_app127.0.0.1
2012-09-04  21:54:00.803  UTC LOG:   duration:  0.068  ms  statement:  BEGIN;  
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
dba test_app127.0.0.1
2012-09-04  21:54:00.804  UTC LOG:   duration:  0.410  ms  statement:  SET TIME 
ZONE E'Pacific/Auckland'
dba test_app127.0.0.1
2012-09-04  21:54:00.805  UTC ERROR:   duplicate key value violates unique 
constraint"country_of_origin_code_key"|


Many thanks!

--
Bayard 'Kit' Randel / Software Developer
Faculty of Medicine, University of Otago

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


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



Re: Django deployment questions

2012-09-04 Thread Stephen Anto
Hi Guys,

For Django related questions and 
answers Pls 
visit http://www.f2finterview.com/web/Django/

On Sunday, September 2, 2012 10:37:03 AM UTC+5:30, Mike wrote:
>
> I just started to use Fabric to automate my deployments to my staging 
> server. (and when I'm ready, to the production server as well).  I have 
> just a few questions for more experienced folks:
>
> Do you clone your whole git repository onto your server, or upload a new 
> archive each time you release?  Seems like it would be easier to switch 
> versions of the running code, by switching tags, but it would use up a lot 
> more disk space. I'd also have to have an ssh key to the central git 
> repository on the web server.  Sounds like that could be a security issue. 
> At the moment I'm programming Fabric to upload an archive, untar it, and 
> symlink it to a fixed directory where the web server expects it to be.
>
> Do you log out all users or just reset the sessions (manage.py reset 
> sessions)?
>
> thanks!
>

-- 
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/-/MhMSmQ31qUsJ.
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: No ROLLBACK within TestCase on second database

2012-09-04 Thread Kit Randel
On 05/09/12 16:28, Mike Dewhirst wrote:
I asked about this a couple of weeks ago and the correct solution is to use a 
TransactionTestCase

Hi Mike,

I don't want to be explicitly test transactional behaviour, which I think is 
the intention behind TransactionTestCase. I just want each test running a 
transaction which rolls back on teardown. The django documentation for TestCase 
seems to suggest that TestCase should provide the behaviour I'm wanting:

class TestCase
Wraps each test in a transaction.

https://docs.djangoproject.com/en/dev/topics/testing/#testcase

Explicitly calling connection._rollback() in a TransactionTestCase 
unfortunately has the same behaviour and only calls ROLLBACK on the 'default' 
database.

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



Re: No ROLLBACK within TestCase on second database

2012-09-04 Thread Mike Dewhirst

On 5/09/2012 3:09pm, Kit Randel wrote:

On 05/09/12 16:28, Mike Dewhirst wrote:

I asked about this a couple of weeks ago and the correct solution is
to use a TransactionTestCase


Hi Mike,

I don't want to be explicitly test transactional behaviour, which I
think is the intention behind TransactionTestCase. I just want each test
running a transaction which rolls back on teardown. The django
documentation for TestCase seems to suggest that TestCase should provide
the behaviour I'm wanting:

/class/TestCase
Wraps each test in a transaction.

https://docs.djangoproject.com/en/dev/topics/testing/#testcase


In your earlier post you mention Django 1.2 but the reference you quote 
above is the dev documentation. There are differences in the docs but 
I'm not sure what the underlying code differences might be.


You are right though. If you want to test commits and rollbacks 
TransactionTestCase is your thing. By my reading of both 1.2 and dev 
docs, vanilla TestCase imported from Django on the other hand should 
handle commits and rollbacks itself.


As to your second database, I can't help because I have zero experience 
with multiple databases. However, I think I have recently seen a caveat 
in the docs somewhere about testing with multiple database. I haven't 
looked in the 1.2 docs for some time.


Mike


Explicitly calling connection._rollback() in a TransactionTestCase
unfortunately has the same behaviour and only calls ROLLBACK on the
'default' database.



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



Authentication across projects

2012-09-04 Thread yillkid
Hi all .
I have two projects (A and B), different django installation, database, but 
same host.

I want the B projects share A project User database table.  
So A user account can login into B project site, but we don't create any 
user account in B project.
and I have already search many information about that.

1. REMOTE_USER
2. django multi database table
3. remote authentication

but I don't know what is the typical solution ?

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



Using array for making form

2012-09-04 Thread Satinderpal Singh
Hi,
I want to make a form in such a way that the contents of the form
should be declared in the array, and also the user details field
corresponding to that contents of the form, which a user fills, should
also be in array in the the models of the project.
I currently use to do this like:

class soil_oshr(models.Model):
date_of_testing = models.CharField(max_length=255)
type_of_str = models.CharField(max_length=255)
latitude_N = models.CharField(max_length=255,blank=True)
longitude_E = models.CharField(max_length=255,blank=True)
presence_1 = models.CharField(max_length=255)
presence_2 = models.CharField(max_length=255,blank=True)
submitted_1 = models.CharField(max_length=255)
submitted_2 = models.CharField(max_length=255,blank=True)
submitted_3 = models.CharField(max_length=255,blank=True)
site_name = models.CharField(max_length=255)
water_table = models.CharField(max_length=255)
depth_D = models.CharField(max_length=255)
water_table = models.CharField(max_length=255)
def __str__(self):
return self.date_of_testing

class soil_oshrForm(ModelForm):
class Meta :
model = soil_oshr
The thing i need that in case of above class "soil_ohsr" the choices
like "date_of_testing", "type_of_str", "latitude_N", and their values
which are in charfields, should be declared as array to avoid the
lengthy code.
If anybody tell me how i'll do it. Thanks in advance.

-- 
Satinderpal Singh
http://satindergoraya.blogspot.in/
http://satindergoraya91.blogspot.in/

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