Re: [ver 1.5] AbstractBaseUser not found?

2013-01-25 Thread scott212
Thanks, Joey! Would've saved me a lot of time if they'd included that in 
the example!

-s

On Friday, January 25, 2013 7:04:08 AM UTC-8, JoeLinux wrote:
>
> Scott,
>
> There is no django.db.models.AbstractBaseUser model. Try adding this to 
> your import statements:
>
> from django.contrib.auth.models import AbstractBaseUser
>
> Hope that helps.
>
> --
> Joey "JoeLinux" Espinosa*
> *
>  
> 
>  
>
> On Fri, Jan 25, 2013 at 10:02 AM, scott212  > wrote:
>
>> Here's the docs I'm using: 
>> https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model
>>
>>
>> On Friday, January 25, 2013 7:00:47 AM UTC-8, scott212 wrote:
>>>
>>> I'm trying to take Django 1.5 for a spin (used older versions for a 
>>> while) to create a basic user that authenticates by email. I'm using the 
>>> docs for 1.5 and it says to inherit AbstractBaseUser but oddly, it doesn't 
>>> seem to be available to use. Here's my code:
>>>
>>> from django.db import models
>>>
>>> class User(models.AbstractBaseUser):**
>>> identifier = models.EmailField(max_length=**254)
>>> first_name = models.CharField()
>>> last_name  = models.CharField()
>>> 
>>> REQUIRED_FIELDS = ['first_name','last_name']
>>>
>>> Here's what I get back from syncdb:
>>>
>>> *new-host-2:locations_site scott$* python manage.py syncdb
>>> AttributeError: 'module' object has no attribute 'AbstractBaseUser'
>>>
>>>  I've tried the import every different way I can think of. What am I 
>>> missing?
>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>>
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

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




Re: webhosting for django projects with SQLite

2013-01-25 Thread Frankline
+1 for Webfaction. Simple to use. Though I'm using Postgres, SQLite can
also be used IMO.

On Sat, Jan 26, 2013 at 8:31 AM, william ratcliff <
william.ratcl...@gmail.com> wrote:

> I'll second webfaction, but just curious--why SQLite?   They make Postgres
> not so hard to set up...
>
>
> On Sat, Jan 26, 2013 at 12:02 AM, Carlos Daniel Ruvalcaba Valenzuela <
> clsdan...@gmail.com> wrote:
>
>> I can only speak for what I have tried, Webfaction can be an option
>> that supports what you want and is a simple as regular hosting, if you
>> are going for the cheap vps route any will do as you have direct
>> control over the python install, modules or virtualenv in the server.
>>
>> Regards,
>> Carlos Ruvalcaba
>>
>> On Fri, Jan 25, 2013 at 9:44 PM, Dandan  wrote:
>> > Which webhosting services support django and SQLite?
>> >
>> > --
>> > 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.
>> > Visit this group at http://groups.google.com/group/django-users?hl=en.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: webhosting for django projects with SQLite

2013-01-25 Thread Carlos Daniel Ruvalcaba Valenzuela
I can only speak for what I have tried, Webfaction can be an option
that supports what you want and is a simple as regular hosting, if you
are going for the cheap vps route any will do as you have direct
control over the python install, modules or virtualenv in the server.

Regards,
Carlos Ruvalcaba

On Fri, Jan 25, 2013 at 9:44 PM, Dandan  wrote:
> Which webhosting services support django and SQLite?
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




webhosting for django projects with SQLite

2013-01-25 Thread Dandan
Which webhosting services support django and SQLite?

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




Where do I place a CSV file so that it can displayed DYGraph Visualization in the Browser?

2013-01-25 Thread Naval Gupte
Hi,

I am trying to use DYGraphs to have a Charting utility in my Web Browser. 
The instructions say "Make sure your CSV file is readable and serving from 
a place that understands XMLHttpRequest's". Where should I place this file 
in my Django Project? I can get the tool to display the chart, if I have 
the CSV values hard coded in my JS script.

Thanks in advance!
Naval

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




Re: Moving a Django website to another server

2013-01-25 Thread Addy Yeow
I was looking for a consistent and error-free deployment as I switch
between servers frequently despite using the same public domain. rsync
was great but I had to manually reload server thereafter or issue a
syncdb, etc.

I have since moved to Fabric for my deployment needs. See
http://docs.fabfile.org/en/1.5/tutorial.html.
With Fabric, I only need to issue one command for daily deployment to
existing or new server, e.g. fab deploy, under my Django project
directory to deploy the project.

On Sat, Jan 26, 2013 at 9:04 AM, Adrián Espinosa
 wrote:
> If both hosts are Linux, you can use "rsync -avuzr source destination".
> Option -z enables compression
>
> On Friday, January 25, 2013 11:20:49 AM UTC+1, John Robertson wrote:
>>
>> Hi there, if I want to move a Django website to another host, is it as
>> simple as copying across all the site files and DB (and changing config
>> files)? If so, is there some kind of tool to create a zipped folder of the
>> website so that FTP does not take several hours! Sorry if this seems a very
>> basic question, but I just wanted to check before I proceed with it. They
>> are fairly simple, small sites, but still there are thousands of files.
>>
>> Many thanks!
>> John
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




Re: Moving a Django website to another server

2013-01-25 Thread Adrián Espinosa
If both hosts are Linux, you can use "rsync -avuzr source destination". 
Option -z enables compression 

On Friday, January 25, 2013 11:20:49 AM UTC+1, John Robertson wrote:
>
> Hi there, if I want to move a Django website to another host, is it as 
> simple as copying across all the site files and DB (and changing config 
> files)? If so, is there some kind of tool to create a zipped folder of the 
> website so that FTP does not take several hours! Sorry if this seems a very 
> basic question, but I just wanted to check before I proceed with it. They 
> are fairly simple, small sites, but still there are thousands of files.
>
> Many thanks!
> John
>

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




Re: ImageField upload_to issue

2013-01-25 Thread Leonardo S
There is no t_upload_path


2013/1/25 Sammael 

> Hello, folks!
>
> Here is the relevant part of my model:
>
> def i_upload_to(instance, filename):
> return '/'.join([strftime('i/%y%m/%d'), filename])
>
> def t_upload_to(instance, filename):
> return '/'.join([strftime('t/%y%m/%d'), filename])
>
> class Image(models.Model):
> image = models.ImageField(upload_to=i_upload_to, blank=True)
> thumbnail = models.ImageField(upload_to=t_upload_to, blank=True)
>
>
> It works as expected, but it's really ugly, terrible code. Let's try to make 
> it a little better:
>
> def upload_path(p):
> return lambda instance, filename: '/'.join([p, strftime('%y%m/%d'), 
> filename])
>
>
> class Image(models.Model):
> image = models.ImageField(upload_to=upload_path('i'), blank=True)
> thumbnail = models.ImageField(upload_to=t_upload_path('t'), 
> blank=True)
>
>
> In this case 'image' will be uploaded where expected (e.g. 'i/1301/26'),
> but thumbnail will be uploaded to directory like 't/1301/25/i/1301/26/'
> instead of 't/1301/26'.
>
> Any opinions? Where do I make a mistake?
>
> Thank you in advance for any advice.
>
>  --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




ImageField upload_to issue

2013-01-25 Thread Sammael
Hello, folks!

Here is the relevant part of my model:

def i_upload_to(instance, filename):
return '/'.join([strftime('i/%y%m/%d'), filename])

def t_upload_to(instance, filename):
return '/'.join([strftime('t/%y%m/%d'), filename])

class Image(models.Model):
image = models.ImageField(upload_to=i_upload_to, blank=True)
thumbnail = models.ImageField(upload_to=t_upload_to, blank=True)


It works as expected, but it's really ugly, terrible code. Let's try to make it 
a little better:

def upload_path(p):
return lambda instance, filename: '/'.join([p, strftime('%y%m/%d'), 
filename])


class Image(models.Model):
image = models.ImageField(upload_to=upload_path('i'), blank=True)
thumbnail = models.ImageField(upload_to=t_upload_path('t'), blank=True)


In this case 'image' will be uploaded where expected (e.g. 'i/1301/26'), 
but thumbnail will be uploaded to directory like 't/1301/25/i/1301/26/' 
instead of 't/1301/26'.

Any opinions? Where do I make a mistake?

Thank you in advance for any advice.

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




Getting related values from map table with foreign keys

2013-01-25 Thread Isaac Perez
Hi,

I'm building an app that has some text with tags, the tags are mapped to 
the text through a mapping table (toxi model).
Something like that:
TEXTID <-->TAGID<-->TAGID
TEXT  TEXTID TAG
What would be the best way to display the text and its tags?

I'm very new to django, and programming in any case,  I can create a list 
for the texts for a certain user, but I don't see how to add only the tags 
for that text in the same list or create somehow a hash with both values.

Is there a django way to do this?

Thanks,
Isaac

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




RE: Please explain this django admin code

2013-01-25 Thread Babatunde Akinyanmi
Thanks Russ :)

Sent from my Windows Phone

-Original Message-
From: Russell Keith-Magee
Sent: 1/25/2013 4:08 PM
To: django-users@googlegroups.com
Subject: Re: Please explain this django admin code




On Fri, Jan 25, 2013 at 10:36 PM, Tundebabzy  wrote:

 I'll be really grateful if someone can take the time to explain these
lines of code. Its from contrib.admin.options

def wrap(view):
def wrapper(*args, **kwargs):
return self.admin_site.admin_view(view)(*args,
**kwargs)# This is the brain twisting line
 return update_wrapper(wrapper, view)

The syntax foo.bar()(*osama **obama) is just blowing fuses in my brain
and then from the code above, I can't even find where admin_view is
defined.






Admin is really composed of two types of object -- an Admin Site
object, and a collection of ModelAdmin objects. The AdminSite object
governs the access to the admin site; a ModelAdmin object exists for
each model registered with the admin. As a result of that
relationship, every ModelAdmin object also knows the site that it is a
part of.




So - if you're in contrib.admin.options, you're looking at the code
for the ModelAdmin object. self.admin_site refers to the site that the
ModelAdmin instance belongs to; the admin_view method belongs to that
site object. It's essentially a decorator providing the permissions
check for the current user.




A decorator is just a function that takes a function as an argument,
and returns a function as a result. Since it returns a function, the
return value can itself be invoked.




So:




self.admin_site




is the admin site.




self.admin_site.admin_view




is a decorator method.




self.admin_site.admin_view(my_view)




is the application of the decorator applied to a specific view




self.admin_site.admin_view(my_view)(*args, **kwargs)




is the invocation of the decoration result using the given args and kwargs.




Yours,

Russ Magee %-)

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

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




RE: Please explain this django admin code

2013-01-25 Thread Babatunde Akinyanmi
Thanks Russ :)

Sent from my Windows Phone
--
From: Russell Keith-Magee
Sent: 1/25/2013 4:08 PM
To: django-users@googlegroups.com
Subject: Re: Please explain this django admin code



On Fri, Jan 25, 2013 at 10:36 PM, Tundebabzy  wrote:

> I'll be really grateful if someone can take the time to explain these
> lines of code. Its from contrib.admin.options
>
> def wrap(view):
> def wrapper(*args, **kwargs):
> return self.admin_site.admin_view(view)(*args,
> **kwargs)# This is the brain twisting line
> return update_wrapper(wrapper, view)
>
> The syntax foo.bar()(*osama **obama) is just blowing fuses in my brain and
> then from the code above, I can't even find where admin_view is defined.
>
>
Admin is really composed of two types of object -- an Admin Site object,
and a collection of ModelAdmin objects. The AdminSite object governs the
access to the admin site; a ModelAdmin object exists for each model
registered with the admin. As a result of that relationship, every
ModelAdmin object also knows the site that it is a part of.

So - if you're in contrib.admin.options, you're looking at the code for the
ModelAdmin object. self.admin_site refers to the site that the ModelAdmin
instance belongs to; the admin_view method belongs to that site object.
It's essentially a decorator providing the permissions check for the
current user.

A decorator is just a function that takes a function as an argument, and
returns a function as a result. Since it returns a function, the return
value can itself be invoked.

So:

self.admin_site

is the admin site.

self.admin_site.admin_view

is a decorator method.

self.admin_site.admin_view(my_view)

is the application of the decorator applied to a specific view

self.admin_site.admin_view(my_view)(*args, **kwargs)

is the invocation of the decoration result using the given args and kwargs.

Yours,
Russ Magee %-)

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

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




Re: 2 projects, 2 apps, bad templates ...

2013-01-25 Thread Micky Hulse
On Thu, Jan 24, 2013 at 7:38 PM, Tomas Neme  wrote:
> just to clarify:
> 

Whoa, that really helps clarify the setup!!! Very helpful! Thank you Tomas!!!

Until we can convert to virtual envs, your suggested solution(s) and
fixes should make me sleep easier at night.

Have an awesome day! :)

Cheers,
M

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




Re: 2 projects, 2 apps, bad templates ...

2013-01-25 Thread Micky Hulse
Hi Tomas! A million thanks for you help!

On Thu, Jan 24, 2013 at 7:34 PM, Tomas Neme  wrote:
> really, it should be your SHORT term goal.

Without airing our dirty laundry, I can't argue with that. I will push
a little harder to get us to convert our projects to envs sooner than
later. :)

> As for your problem, you can't expect to install FOOAPP in two
> different directories on the same environment (system global, in this
> case) and expect that to work OK.

I was worried about that. The decision to install the app in the other
project was the Django noob in me shinning through. :D

> You're supposed to install that just once, and USE it from different
> projects, if that's what you want to do. Also, if you're installing in
> the global system python installation, you should not put them under
> any single project's directory, but rather somewhere outside them,
> because otherwise you'll end up with modules that can be reached from
> two different paths (FOOAPP and ProjectA.FOOAPP) and that's bad.

Excellent tip. Thank you for giving me a fix. :)

To be honest, this was the first time I've used one app in multiple
projects, so we've never run into this problem before.

> Now for the templates. If you're making a reusable app and providing
> templates with it, you should do your best to make the templates
> reusable as well. The standard procedure is to have them under an
>  directory like this:
> AppDir/templates/appname/TemplateFiles.html
> so the idea is that if you need special modifications for a project,
> you can put your special templates in your project's
> templates/appname/ directory, and the template loader will find your
> local templates before it falls back to the app's directory.
> I hope that's clear enough.

Definitely! In fact, that's probably the one thing that I was doing right. :D

Only, in the case of DjangoProjectB.FOOAPP, we put new templates in
DjangoProjectB/templates/FOOAPP/TemplateFiles.html.

> Also, make sure your app has a MANIFEST for setup.py to be able to
> install non-python files (e.g.: your templates) when you install it
> without the -e option. Look at the distutils docs for more details

Interesting! Thanks for that tip as well!

I do have a MANIFEST.in file which has:

include *.md
+include LICENSE

(I think the pip installer did not like the +)

I did not realize that I should account for templates like you say! I
appreciate the advice.

Thanks again Tomas! I owe you one! :)

Cheers,
M

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




Re: Moving a Django website to another server

2013-01-25 Thread Oscar Carballal
Bill has a point, I assumed both were VPSs that had the same services,
software and directory structures. If you change that, then it will be
a bit more of work :)

2013/1/25 Bill Freeman :
> What kind of hosts?  if both are linux, then tar is your friend, using the
> -z or -j options
> to create compressed archives, though zip and unzip commands are likely
> available
> too.  If you use ftp (faster, but less secure than scp/sftp), be sure to
> transfer in binary
> mode (text is the default, and will cause problems for bytes in the
> compressed file
> that look like carriage return or line feed).
>
> Whether it is just a matter of copying "everything" depends on how
> compatible the
> two machines are.  For example, if you are using the system's base python,
> rather
> than installing one of your own, and the two are different versions, they
> .pyc files
> will not be compatible.  Also, if you installed django and other apps
> naively, they
> may be in directories that you aren't copying.  It is also possible that
> there are
> dependencies (libraries linked against by the egg installers) that are
> missing
> or incompatible on the new box.  There are also presumably http server and
> database servers that need to be installed, and which have configuration
> files.
> So, unless you're cloning the whole OS install onto a compatible piece of
> hardware
> (and even there you should do things like fix up the network configuration
> and
> ssh machine keys) I think that you're going to have trouble "just copy"ing.
>
> Bill
>
> On Fri, Jan 25, 2013 at 10:22 AM, Oscar Carballal  wrote:
>>
>> For our project e-cidadania it was like that, we only had to make a
>> clone of the git repository and we made a symbolic link to the config
>> files (so we can pull the code without affecting the config). After
>> that we made an import into the new database, fix the config files et
>> voilá.
>>
>> You can try SSH if you have it available, via the "scp" command, it's
>> faster and easier in my opinion, but if you only have the FTP
>> available you should take care of the file permissions and user/group.
>>
>> Regards,
>> Oscar Carballal
>>
>> 2013/1/25 John Robertson :
>> > Hi there, if I want to move a Django website to another host, is it as
>> > simple as copying across all the site files and DB (and changing config
>> > files)? If so, is there some kind of tool to create a zipped folder of
>> > the
>> > website so that FTP does not take several hours! Sorry if this seems a
>> > very
>> > basic question, but I just wanted to check before I proceed with it.
>> > They
>> > are fairly simple, small sites, but still there are thousands of files.
>> >
>> > Many thanks!
>> > John
>> >
>> > --
>> > 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.
>> > Visit this group at http://groups.google.com/group/django-users?hl=en.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




Re: Moving a Django website to another server

2013-01-25 Thread Bill Freeman
What kind of hosts?  if both are linux, then tar is your friend, using the
-z or -j options
to create compressed archives, though zip and unzip commands are likely
available
too.  If you use ftp (faster, but less secure than scp/sftp), be sure to
transfer in binary
mode (text is the default, and will cause problems for bytes in the
compressed file
that look like carriage return or line feed).

Whether it is just a matter of copying "everything" depends on how
compatible the
two machines are.  For example, if you are using the system's base python,
rather
than installing one of your own, and the two are different versions, they
.pyc files
will not be compatible.  Also, if you installed django and other apps
naively, they
may be in directories that you aren't copying.  It is also possible that
there are
dependencies (libraries linked against by the egg installers) that are
missing
or incompatible on the new box.  There are also presumably http server and
database servers that need to be installed, and which have configuration
files.
So, unless you're cloning the whole OS install onto a compatible piece of
hardware
(and even there you should do things like fix up the network configuration
and
ssh machine keys) I think that you're going to have trouble "just copy"ing.

Bill

On Fri, Jan 25, 2013 at 10:22 AM, Oscar Carballal  wrote:

> For our project e-cidadania it was like that, we only had to make a
> clone of the git repository and we made a symbolic link to the config
> files (so we can pull the code without affecting the config). After
> that we made an import into the new database, fix the config files et
> voilá.
>
> You can try SSH if you have it available, via the "scp" command, it's
> faster and easier in my opinion, but if you only have the FTP
> available you should take care of the file permissions and user/group.
>
> Regards,
> Oscar Carballal
>
> 2013/1/25 John Robertson :
> > Hi there, if I want to move a Django website to another host, is it as
> > simple as copying across all the site files and DB (and changing config
> > files)? If so, is there some kind of tool to create a zipped folder of
> the
> > website so that FTP does not take several hours! Sorry if this seems a
> very
> > basic question, but I just wanted to check before I proceed with it. They
> > are fairly simple, small sites, but still there are thousands of files.
> >
> > Many thanks!
> > John
> >
> > --
> > 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.
> > Visit this group at http://groups.google.com/group/django-users?hl=en.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: regarding output

2013-01-25 Thread Bill Freeman
Let's divide and conquer.  Try commenting out the stuff creating and using
"p"
and instead do

  response.write("this is a test")

See if you get a file to save in the browser, and save it, rather than
opening
it, since it won't really be pdf.  Then look at the file with something
like less
in a command line - don't try double clicking on the file, it's still not a
pdf to
see if it has the desired text.  If that works the Django side of things is
good.

I haven't touched reportlab in a few years, so I don't remember if a Canvas
is the kind of object that you need (whether it even has a save method),
so the reportlab mailing list, or getting a simple reportlab example to
write
to an open file object, would be your alternatives.

Bill

On Fri, Jan 25, 2013 at 5:26 AM,  wrote:

> from reportlab.pdfgen import canvas
> from django.http import HttpResponse
>
> def some_view(request):
> # Create the HttpResponse object with the appropriate PDF headers.
> response = HttpResponse(mimetype='application/pdf')
> response['Content-Disposition'] = 'attachment;
> filename="somefilename.pdf"'
>
> # Create the PDF object, using the response object as its "file."
> p = canvas.Canvas(response)
>
> # Draw things on the PDF. Here's where the PDF generation happens.
> # See the ReportLab documentation for the full list of functionality.
> p.drawString(100, 100, "Hello world.")
>
>
> # Close the PDF object cleanly, and we're done.
> p.showPage()
> p.save()
> return response
>
>
> this is my code , i wanna know where the output of this program is saved.
> M not able to retrieve the out put plz help me out.
> thanks in advance
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Again, Model and ModelForm validation

2013-01-25 Thread Fabio Natali

Hi everybody,

suppose I have a model and want to add some custom validation to *just 
one* of its fields. Using Django 1.4 here.


I expect that specific validation constraint to be used both in my forms 
and in my save method.


Should I better use Model clean_fields() method? Or the clean() one? Or 
should I better rely on a custom ModelForm? Or, again, should I use a 
custom save method?


In each case, how can I then propagate my ValidationError to the form so 
that my specific field is highlighted in case the user inserts some 
invalid data?


Any snippet or web reference is greatly appreciated.

Cheers, Fabio.

--
Fabio Natali

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




Model and ModelForm validation

2013-01-25 Thread Fabio Natali

Hi everybody.

I am reading this [0] and can't perfectly understand what this line means:

"Note that full_clean() will not be called automatically when you call 
your model's save() method, nor as a result of ModelForm validation. 
You'll need to call it manually when you want to run one-step model 
validation for your own manually created models."


Specifically, I am referring to "nor as a result of ModelForm 
validation". Does it mean full_clean() is not called during ModelForm 
validation? I was pretty sure it is... Am I wrong? Am I misunderstanding 
that English line (I am not a native speaker)?


Cheers, Fabio.

[0] 
https://docs.djangoproject.com/en/1.4/ref/models/instances/#django.db.models.Model.full_clean


--
Fabio Natali

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




Re: Foreing Key field going null in INSERT sql when use inlineformset

2013-01-25 Thread Fellipe Henrique
I can't use AutoField, because I need to use my StoreProcedure. I use this
StoreProcedure in my Delphi application.



T.·.F.·.A.·. S+F
*Fellipe Henrique P. Soares*

*"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae
morales ad Lucilium,
Lucius Annaeus Seneca)

*"Any intelligent fool can make things bigger, more complex, and more
violent. It takes a touch of genius -- and a lot of courage -- to move in
the opposite direction."*
Albert Einstein (March 14th 1879 – April 18th 1955)


2013/1/25 Anderson 

> Hi Felipe
> try autoField is auto increment.
>
>
> On Fri, Jan 25, 2013 at 4:53 AM, Fellipe Henrique wrote:
>
>> I have this models:
>>
>>
>> class Pedido(models.Model):
>> idvenda_pedido = models.IntegerField(verbose_name=u"Código",
>> primary_key=True, null=False)
>> num_nota = models.IntegerField(verbose_name=u'Nº Nota', blank=True,
>> null=True)
>>
>> class ItensPedido(models.Model):
>> idvenda_pedido_itens = models.IntegerField(u'Código',
>> primary_key=True, null=False, default=-1)
>> idvenda_pedido = models.ForeignKey('Pedido',
>> db_column='idvenda_pedido', null=False, blank=False)
>> qnt = models.IntegerField(verbose_name=u'Quantidade', null=False,
>> blank=False, default=1)
>>
>>
>> When I save ItensPedido, the idvenda_pedido is null. How Can I pass the
>> idvenda_pedido field? I try to pass the integer but django tell me it`s
>> need a "pedido" not integer value.
>>
>>
>> Thanks.
>>
>> T.·.F.·.A.·. S+F
>> *Fellipe Henrique P. Soares*
>>
>> *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae
>> morales ad 
>> Lucilium,
>> Lucius Annaeus Seneca)
>>
>> *"Any intelligent fool can make things bigger, more complex, and more
>> violent. It takes a touch of genius -- and a lot of courage -- to move in
>> the opposite direction."*
>> Albert Einstein (March 14th 1879 – April 18th 1955)
>>
>> --
>> 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.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Anderson Dias Borges
> Senior Analyst Developer
>
> Tu cumprirás o desejo do meu coração se eu Te buscar...
> I can't see but I'll take my chances
> To hear You call my name
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: Please explain this django admin code

2013-01-25 Thread carlos
excellent explanation did not know anything about it

thank Russ :)


On Fri, Jan 25, 2013 at 9:08 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

>
>
> On Fri, Jan 25, 2013 at 10:36 PM, Tundebabzy  wrote:
>
>> I'll be really grateful if someone can take the time to explain these
>> lines of code. Its from contrib.admin.options
>>
>> def wrap(view):
>> def wrapper(*args, **kwargs):
>> return self.admin_site.admin_view(view)(*args,
>> **kwargs)# This is the brain twisting line
>> return update_wrapper(wrapper, view)
>>
>> The syntax foo.bar()(*osama **obama) is just blowing fuses in my brain
>> and then from the code above, I can't even find where admin_view is defined.
>>
>>
> Admin is really composed of two types of object -- an Admin Site object,
> and a collection of ModelAdmin objects. The AdminSite object governs the
> access to the admin site; a ModelAdmin object exists for each model
> registered with the admin. As a result of that relationship, every
> ModelAdmin object also knows the site that it is a part of.
>
> So - if you're in contrib.admin.options, you're looking at the code for
> the ModelAdmin object. self.admin_site refers to the site that the
> ModelAdmin instance belongs to; the admin_view method belongs to that site
> object. It's essentially a decorator providing the permissions check for
> the current user.
>
> A decorator is just a function that takes a function as an argument, and
> returns a function as a result. Since it returns a function, the return
> value can itself be invoked.
>
> So:
>
> self.admin_site
>
> is the admin site.
>
> self.admin_site.admin_view
>
> is a decorator method.
>
> self.admin_site.admin_view(my_view)
>
> is the application of the decorator applied to a specific view
>
> self.admin_site.admin_view(my_view)(*args, **kwargs)
>
> is the invocation of the decoration result using the given args and kwargs.
>
> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: Moving a Django website to another server

2013-01-25 Thread Oscar Carballal
For our project e-cidadania it was like that, we only had to make a
clone of the git repository and we made a symbolic link to the config
files (so we can pull the code without affecting the config). After
that we made an import into the new database, fix the config files et
voilá.

You can try SSH if you have it available, via the "scp" command, it's
faster and easier in my opinion, but if you only have the FTP
available you should take care of the file permissions and user/group.

Regards,
Oscar Carballal

2013/1/25 John Robertson :
> Hi there, if I want to move a Django website to another host, is it as
> simple as copying across all the site files and DB (and changing config
> files)? If so, is there some kind of tool to create a zipped folder of the
> website so that FTP does not take several hours! Sorry if this seems a very
> basic question, but I just wanted to check before I proceed with it. They
> are fairly simple, small sites, but still there are thousands of files.
>
> Many thanks!
> John
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




regarding output

2013-01-25 Thread nrapeee
from reportlab.pdfgen import canvas
from django.http import HttpResponse

def some_view(request):
# Create the HttpResponse object with the appropriate PDF headers.
response = HttpResponse(mimetype='application/pdf')
response['Content-Disposition'] = 'attachment; 
filename="somefilename.pdf"'

# Create the PDF object, using the response object as its "file."
p = canvas.Canvas(response)

# Draw things on the PDF. Here's where the PDF generation happens.
# See the ReportLab documentation for the full list of functionality.
p.drawString(100, 100, "Hello world.")


# Close the PDF object cleanly, and we're done.
p.showPage()
p.save()
return response


this is my code , i wanna know where the output of this program is saved.
M not able to retrieve the out put plz help me out.
thanks in advance


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




Re: Please explain this django admin code

2013-01-25 Thread Russell Keith-Magee
On Fri, Jan 25, 2013 at 10:36 PM, Tundebabzy  wrote:

> I'll be really grateful if someone can take the time to explain these
> lines of code. Its from contrib.admin.options
>
> def wrap(view):
> def wrapper(*args, **kwargs):
> return self.admin_site.admin_view(view)(*args,
> **kwargs)# This is the brain twisting line
> return update_wrapper(wrapper, view)
>
> The syntax foo.bar()(*osama **obama) is just blowing fuses in my brain and
> then from the code above, I can't even find where admin_view is defined.
>
>
Admin is really composed of two types of object -- an Admin Site object,
and a collection of ModelAdmin objects. The AdminSite object governs the
access to the admin site; a ModelAdmin object exists for each model
registered with the admin. As a result of that relationship, every
ModelAdmin object also knows the site that it is a part of.

So - if you're in contrib.admin.options, you're looking at the code for the
ModelAdmin object. self.admin_site refers to the site that the ModelAdmin
instance belongs to; the admin_view method belongs to that site object.
It's essentially a decorator providing the permissions check for the
current user.

A decorator is just a function that takes a function as an argument, and
returns a function as a result. Since it returns a function, the return
value can itself be invoked.

So:

self.admin_site

is the admin site.

self.admin_site.admin_view

is a decorator method.

self.admin_site.admin_view(my_view)

is the application of the decorator applied to a specific view

self.admin_site.admin_view(my_view)(*args, **kwargs)

is the invocation of the decoration result using the given args and kwargs.

Yours,
Russ Magee %-)

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




Moving a Django website to another server

2013-01-25 Thread John Robertson
Hi there, if I want to move a Django website to another host, is it as 
simple as copying across all the site files and DB (and changing config 
files)? If so, is there some kind of tool to create a zipped folder of the 
website so that FTP does not take several hours! Sorry if this seems a very 
basic question, but I just wanted to check before I proceed with it. They 
are fairly simple, small sites, but still there are thousands of files.

Many thanks!
John

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




Re: Problem configuring Django 1.5b2 with PostGIS 2.0

2013-01-25 Thread Joe Jasinski
I've been experiencing the same issue on OSX 10.8.2.  

$ ./manage.py shell

ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND "geos".

I've installed Postgresapp (http://postgresapp.com/documentation), which 
includes Postgres 9.2.2, PostGIS 2.0.2, GEOS 3.3.5, and Proj (not sure of 
the version, but likely recent).  Note: I also got the same error when 
installing postgres from homebrew.  Various tutorials indicate that I 
should set the following in settings.py. 
 
(http://wiki.bitnami.org/Components/Django/GoeDjango_with_PostGIS_Quick_Start_Guide)

GDAL_LIBRARY_PATH="/Applications/Postgres.app/Contents/MacOS/lib/libgdal.dylib"
GEOS_LIBRARY_PATH="/Applications/Postgres.app/Contents/MacOS/lib/libgeos_c.dylib"
GDAL_DATA="/Applications/Postgres.app/Contents/MacOS/share/gdal"

Upon doing so, I get a different error.  

OSError: 
dlopen(/Applications/Postgres.app/Contents/MacOS/lib/libgeos_c.dylib, 6): 
Library not loaded: @executable_path/../lib/libgeos-3.3.5.dylib
  Referenced from: 
/Applications/Postgres.app/Contents/MacOS/lib/libgeos_c.dylib
  Reason: image not found

Below is evidence that the files from PATH statements above do exist.  

$ ls -la /Applications/Postgres.app/Contents/MacOS/lib/libgdal.dylib
lrwxr-xr-x@ 1 jjasinski  staff  15 Jan 24 20:56 
/Applications/Postgres.app/Contents/MacOS/lib/libgdal.dylib -> 
libgdal.1.dylib

$ ls -la /Applications/Postgres.app/Contents/MacOS/lib/libgeos_c.dylib
lrwxr-xr-x@ 1 jjasinski  staff  17 Jan 24 20:56 
/Applications/Postgres.app/Contents/MacOS/lib/libgeos_c.dylib -> 
libgeos_c.1.dylib

$ ls -ald /Applications/Postgres.app/Contents/MacOS/share/gdal
drwxr-xr-x@ 47 jjasinski  staff  1598 Jan 24 20:56 
/Applications/Postgres.app/Contents/MacOS/share/gdal

My next step is to try to get this running in an Ubuntu virtual machine, 
but I'd really like to get it work natively in OSX. 


On Friday, December 28, 2012 11:05:57 AM UTC-6, Odagi wrote:
>
> Hi, I have been struggling for two days to get a GeoDjango/PostGIS 
> project started and I'll appreciate any help. Thanks
>
> == My project ==
>
> Two virtual machines: 
>Machine 1: Running Django 1.5b2
>Machine 2: Running a geospatial DB server 
> (postgresql-server-dev-9.1, geos-3.3.5, proj-4.8.0, postgis-2.0.2) 
>  
> == My (wrong??) assumption ==
>
> I don't need to install any geos/postgis library on Machine 1. Please let 
> me know if this is incorrect.
>
> == My Problem ==
>
> When I run:
> $  manage.py validate
>
> The result is:
> ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND 
> "geos".
>
> == Tring to fix this ==
>
> In Machine 1 (where I have my Django application), I include this line in 
> settings.py
>
> GEOS_LIBRARY_PATH = '/opt/geos/lib/libgeos_c.so'
>
> But this path is the location of Geos library in Machine 2 (my DB server).
> When I run $ manage.py validate, I get this error:
>
> OSError: /opt/geos/lib/libgeos_c.so: cannot open shared object file: No 
> such file or directory
>
> So, may be I need some Geos libraries in Machine 1 in order to Django 
> communicate with PostGIS, but I'm not sure. 
> Any ideas? 
>  
>
>
>
>
>
>
>
>

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




RE: Please explain this django admin code

2013-01-25 Thread Babatunde Akinyanmi
I found it. Django.contrib.admin.sites defines AdminSite which provides the
admin_view method

Sent from my Windows Phone
--
From: Tundebabzy
Sent: 1/25/2013 3:36 PM
To: django-users@googlegroups.com
Subject: Please explain this django admin code

I'll be really grateful if someone can take the time to explain these lines
of code. Its from contrib.admin.options

def wrap(view):
def wrapper(*args, **kwargs):
return self.admin_site.admin_view(view)(*args, **kwargs)
# This is the brain twisting line
return update_wrapper(wrapper, view)

The syntax foo.bar()(*osama **obama) is just blowing fuses in my brain and
then from the code above, I can't even find where admin_view is defined.

Thanks for your time.

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

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




Re: [ver 1.5] AbstractBaseUser not found?

2013-01-25 Thread Joey Espinosa
Scott,

There is no django.db.models.AbstractBaseUser model. Try adding this to
your import statements:

from django.contrib.auth.models import AbstractBaseUser

Hope that helps.

--
Joey "JoeLinux" Espinosa*
*




On Fri, Jan 25, 2013 at 10:02 AM, scott212  wrote:

> Here's the docs I'm using:
> https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model
>
>
> On Friday, January 25, 2013 7:00:47 AM UTC-8, scott212 wrote:
>>
>> I'm trying to take Django 1.5 for a spin (used older versions for a
>> while) to create a basic user that authenticates by email. I'm using the
>> docs for 1.5 and it says to inherit AbstractBaseUser but oddly, it doesn't
>> seem to be available to use. Here's my code:
>>
>> from django.db import models
>>
>> class User(models.AbstractBaseUser):**
>> identifier = models.EmailField(max_length=**254)
>> first_name = models.CharField()
>> last_name  = models.CharField()
>>
>> REQUIRED_FIELDS = ['first_name','last_name']
>>
>> Here's what I get back from syncdb:
>>
>> *new-host-2:locations_site scott$* python manage.py syncdb
>> AttributeError: 'module' object has no attribute 'AbstractBaseUser'
>>
>> I've tried the import every different way I can think of. What am I
>> missing?
>>
>>
>>  --
> 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.
>
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: [ver 1.5] AbstractBaseUser not found?

2013-01-25 Thread scott212
Here's the docs I'm 
using: 
https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model

On Friday, January 25, 2013 7:00:47 AM UTC-8, scott212 wrote:
>
> I'm trying to take Django 1.5 for a spin (used older versions for a while) 
> to create a basic user that authenticates by email. I'm using the docs for 
> 1.5 and it says to inherit AbstractBaseUser but oddly, it doesn't seem to 
> be available to use. Here's my code:
>
> from django.db import models
>
> class User(models.AbstractBaseUser):
> identifier = models.EmailField(max_length=254)
> first_name = models.CharField()
> last_name  = models.CharField()
> 
> REQUIRED_FIELDS = ['first_name','last_name']
>
> Here's what I get back from syncdb:
>
> *new-host-2:locations_site scott$* python manage.py syncdb
> AttributeError: 'module' object has no attribute 'AbstractBaseUser'
>
> I've tried the import every different way I can think of. What am I 
> missing?
>
>
>

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




[ver 1.5] AbstractBaseUser not found?

2013-01-25 Thread scott212
I'm trying to take Django 1.5 for a spin (used older versions for a while) 
to create a basic user that authenticates by email. I'm using the docs for 
1.5 and it says to inherit AbstractBaseUser but oddly, it doesn't seem to 
be available to use. Here's my code:

from django.db import models

class User(models.AbstractBaseUser):
identifier = models.EmailField(max_length=254)
first_name = models.CharField()
last_name  = models.CharField()

REQUIRED_FIELDS = ['first_name','last_name']

Here's what I get back from syncdb:

*new-host-2:locations_site scott$* python manage.py syncdb
AttributeError: 'module' object has no attribute 'AbstractBaseUser'

I've tried the import every different way I can think of. What am I missing?


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




Re: Foreing Key field going null in INSERT sql when use inlineformset

2013-01-25 Thread Anderson
Hi Felipe
try autoField is auto increment.


On Fri, Jan 25, 2013 at 4:53 AM, Fellipe Henrique wrote:

> I have this models:
>
>
> class Pedido(models.Model):
> idvenda_pedido = models.IntegerField(verbose_name=u"Código",
> primary_key=True, null=False)
> num_nota = models.IntegerField(verbose_name=u'Nº Nota', blank=True,
> null=True)
>
> class ItensPedido(models.Model):
> idvenda_pedido_itens = models.IntegerField(u'Código',
> primary_key=True, null=False, default=-1)
> idvenda_pedido = models.ForeignKey('Pedido',
> db_column='idvenda_pedido', null=False, blank=False)
> qnt = models.IntegerField(verbose_name=u'Quantidade', null=False,
> blank=False, default=1)
>
>
> When I save ItensPedido, the idvenda_pedido is null. How Can I pass the
> idvenda_pedido field? I try to pass the integer but django tell me it`s
> need a "pedido" not integer value.
>
>
> Thanks.
>
> T.·.F.·.A.·. S+F
> *Fellipe Henrique P. Soares*
>
> *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae
> morales ad 
> Lucilium,
> Lucius Annaeus Seneca)
>
> *"Any intelligent fool can make things bigger, more complex, and more
> violent. It takes a touch of genius -- and a lot of courage -- to move in
> the opposite direction."*
> Albert Einstein (March 14th 1879 – April 18th 1955)
>
> --
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Anderson Dias Borges
Senior Analyst Developer

Tu cumprirás o desejo do meu coração se eu Te buscar...
I can't see but I'll take my chances
To hear You call my name

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




Please explain this django admin code

2013-01-25 Thread Tundebabzy
I'll be really grateful if someone can take the time to explain these lines 
of code. Its from contrib.admin.options

def wrap(view):
def wrapper(*args, **kwargs):
return self.admin_site.admin_view(view)(*args, **kwargs)
# This is the brain twisting line
return update_wrapper(wrapper, view)

The syntax foo.bar()(*osama **obama) is just blowing fuses in my brain and 
then from the code above, I can't even find where admin_view is defined.

Thanks for your time.

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




Re: Django & Oracle connection problem

2013-01-25 Thread Dylan Klomparens
Hmm, ok so I guess having a different user name isn't causing the problem. 
I was able to connect to the database from the webserver using SQL 
Developer, and I am sure the credentials are correct. Are there any 
configuration steps that I need to perform for Instant Client or cx_Oracle? 
So far, I have just added the shared library path to the loader so that 
Instant Client can run (i.e. change LD_LIBRARY_PATH environment variable). 
Is there anything else I need to do to configure Instant Client to work 
with Django?

On Friday, January 25, 2013 8:27:38 AM UTC-5, Dan Gentry wrote:
>
> You've probably already tried the simple things:
>
>
>- Confirm that the server name and port are correct.
>- Ensure that firewall/routing rules will allow the connection.
>- Try a simple connection on the same box with sqlplus.
>
>
> Walking through this list has helped me a number of times.
>
>
> On Thursday, January 24, 2013 5:27:22 PM UTC-5, Dylan Klomparens wrote:
>>
>> I have a Django program that is connecting to an Oracle database. In my 
>> settings.py file I have this configuration:
>>
>> DATABASES = {
>>   'default': {
>> 'ENGINE': 'django.db.backends.oracle',
>> 'NAME': 'xe',
>> 'USER': 'MY_USER_NAME',
>> 'PASSWORD': 'abcdefghijklmnopqrstuvwxyz',
>> 'HOST': 'db_server.example.com',
>> 'PORT': '1234',
>>   }}
>>
>> I received a strange error when attempting to load the website:
>>
>> ORA-28547: connection to server failed, probable Oracle Net admin error
>>
>> After further investigation, I sniffed the TCP traffic between the 
>> webserver and the database server. I discovered this text in the network 
>> communication, which I reformatted for this post:
>>
>> (DESCRIPTION=
>> (ADDRESS=
>> (PROTOCOL=TCP)
>> (HOST=1.2.3.4)
>> (PORT=1234)
>> )
>> (CONNECT_DATA=
>> (SID=xe)
>> (CID=
>> (PROGRAM=httpd@webserver_hostname)
>> (HOST=webserver_hostname)
>> (USER=apache)
>> )
>> ))
>>
>> So my question is: why is Django attempting to connect to the Oracle 
>> database with different credentials than the ones I specified? Notably, it 
>> is attempting to use user 'apache' instead of 'MY_USER_NAME'. The database 
>> host IP, port, and SID are correct and what I specified. It just appears to 
>> be the user name that is different.
>>
>> (As a side note, I suppose the password is transmitted separately in a 
>> later portion of the log in process?)
>>
>

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




Re: Which django-cart fork should I use?

2013-01-25 Thread Leonardo S
Hi,

I used this fork once
http://code.google.com/u/101353298620714815735/

But i didn't install. I created my own version based on its code.

Em sexta-feira, 25 de janeiro de 2013, frocco escreveu:
> Hello,
> I installed pip install django-cart, but am having issues when trying to
update a cart with a different qty.
> nothing happens. I see no errors in debug.
> a new product is added ok, but if I try and add the product again, the
qty is not changed.
> if I call the update_cart method, the qty is not changed.
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Which django-cart fork should I use?

2013-01-25 Thread frocco
Hello,

I installed pip install django-cart, but am having issues when trying to 
update a cart with a different qty.
nothing happens. I see no errors in debug.

a new product is added ok, but if I try and add the product again, the qty 
is not changed.
if I call the update_cart method, the qty is not changed.

Thanks

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




Re: Django & Oracle connection problem

2013-01-25 Thread Dan Gentry
You've probably already tried the simple things:


   - Confirm that the server name and port are correct.
   - Ensure that firewall/routing rules will allow the connection.
   - Try a simple connection on the same box with sqlplus.
   

Walking through this list has helped me a number of times.


On Thursday, January 24, 2013 5:27:22 PM UTC-5, Dylan Klomparens wrote:
>
> I have a Django program that is connecting to an Oracle database. In my 
> settings.py file I have this configuration:
>
> DATABASES = {
>   'default': {
> 'ENGINE': 'django.db.backends.oracle',
> 'NAME': 'xe',
> 'USER': 'MY_USER_NAME',
> 'PASSWORD': 'abcdefghijklmnopqrstuvwxyz',
> 'HOST': 'db_server.example.com',
> 'PORT': '1234',
>   }}
>
> I received a strange error when attempting to load the website:
>
> ORA-28547: connection to server failed, probable Oracle Net admin error
>
> After further investigation, I sniffed the TCP traffic between the 
> webserver and the database server. I discovered this text in the network 
> communication, which I reformatted for this post:
>
> (DESCRIPTION=
> (ADDRESS=
> (PROTOCOL=TCP)
> (HOST=1.2.3.4)
> (PORT=1234)
> )
> (CONNECT_DATA=
> (SID=xe)
> (CID=
> (PROGRAM=httpd@webserver_hostname)
> (HOST=webserver_hostname)
> (USER=apache)
> )
> ))
>
> So my question is: why is Django attempting to connect to the Oracle 
> database with different credentials than the ones I specified? Notably, it 
> is attempting to use user 'apache' instead of 'MY_USER_NAME'. The database 
> host IP, port, and SID are correct and what I specified. It just appears to 
> be the user name that is different.
>
> (As a side note, I suppose the password is transmitted separately in a 
> later portion of the log in process?)
>

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




RE: regex

2013-01-25 Thread Babatunde Akinyanmi
'.' matches any character except a new line

Sent from my Windows Phone
--
From: arm
Sent: 1/25/2013 10:09 AM
To: django-users@googlegroups.com
Subject: regex

Hi,

I'm trying to figure out the regular expressions that will match any number
and punctuation and chars like +,#,§ etc . Any advice?




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

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




Re: regex

2013-01-25 Thread Larry Martell
On Fri, Jan 25, 2013 at 2:09 AM, arm  wrote:
>
> Hi,
>
> I'm trying to figure out the regular expressions that will match any
> number and punctuation and chars like +,#,§ etc . Any advice?


http://www.regular-expressions.info/charclass.html

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




Foreing Key field going null in INSERT sql when use inlineformset

2013-01-25 Thread Fellipe Henrique
I have this models:


class Pedido(models.Model):
idvenda_pedido = models.IntegerField(verbose_name=u"Código",
primary_key=True, null=False)
num_nota = models.IntegerField(verbose_name=u'Nº Nota', blank=True,
null=True)

class ItensPedido(models.Model):
idvenda_pedido_itens = models.IntegerField(u'Código', primary_key=True,
null=False, default=-1)
idvenda_pedido = models.ForeignKey('Pedido',
db_column='idvenda_pedido', null=False, blank=False)
qnt = models.IntegerField(verbose_name=u'Quantidade', null=False,
blank=False, default=1)


When I save ItensPedido, the idvenda_pedido is null. How Can I pass the
idvenda_pedido field? I try to pass the integer but django tell me it`s
need a "pedido" not integer value.


Thanks.

T.·.F.·.A.·. S+F
*Fellipe Henrique P. Soares*

*"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae
morales ad Lucilium,
Lucius Annaeus Seneca)

*"Any intelligent fool can make things bigger, more complex, and more
violent. It takes a touch of genius -- and a lot of courage -- to move in
the opposite direction."*
Albert Einstein (March 14th 1879 – April 18th 1955)

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




Re: define form in yaml file

2013-01-25 Thread Adrian Andreias
Hi Leonardo,

I was talking about something I want to implement (or looking for a 3rd 
party implementation), not a standard Django feature.

Users would define forms in format they input, which in turn will be used 
to generate forms displayed in browser for other users.
If I allow users to input Python code they might input anything they like, 
for instance they might add in their Python code subprocess.Popen("rm -rf 
/*") :D.

This is an obvious security no-no, regardless of language or framework.

joi, 24 ianuarie 2013, 22:19:28 UTC+2, leonardo a scris:
>
> Hi,
>
> I'm new to Django and here.
>
> yaml file is commonly used in Rails framework.
> Django uses simple python file (settings.py).
>
> What security risk? Have you got any example ?
>
>
> 2013/1/24 Adrian Andreias 
>
>> Hello,
>>
>> I need a way to define a django form through a yaml file (or another text 
>> format).
>> Is there some code that already does this?
>> I'm trying to not reinvent the wheel.
>>
>> I can't use simple python classes, since this would user input and would 
>> be a security risk and I need a simpler and limited format.
>>
>> 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/-/bSxNCc8waMUJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

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




Re: define form in yaml file

2013-01-25 Thread Adrian Andreias
Hi,

Yes, this sounds interesting.
Push to github if your project allows this. :)

Thank you


vineri, 25 ianuarie 2013, 00:57:58 UTC+2, Chris Hinds a scris:
>
> Hey,
>
> I've got a project where models, forms and templates are all generated 
> from a single yaml file. It works well here as the forms are long, with a 
> fair amount of layout and plenty of formsets. 
>
> I'm doing a refactor at the moment which should yield some reusable bits. 
> I'd be very happy to share.
>
> In general terms for model/form construction, I transform the original 
> spec it to something that jsonpickle can deliver into type().
>
> Can talk more if this sounds at all interesting.
>
> Cheers
>
> Chris.
>
> On Thursday, January 24, 2013 8:02:53 PM UTC, Adrian Andreias wrote:
>>
>> Hello,
>>
>> I need a way to define a django form through a yaml file (or another text 
>> format).
>> Is there some code that already does this?
>> I'm trying to not reinvent the wheel.
>>
>> I can't use simple python classes, since this would user input and would 
>> be a security risk and I need a simpler and limited format.
>>
>> Thanks
>>
>>

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




Re: define form in yaml file

2013-01-25 Thread Adrian Andreias



vineri, 25 ianuarie 2013, 00:57:58 UTC+2, Chris Hinds a scris:
>
> Hey,
>
> I've got a project where models, forms and templates are all generated 
> from a single yaml file. It works well here as the forms are long, with a 
> fair amount of layout and plenty of formsets. 
>
> I'm doing a refactor at the moment which should yield some reusable bits. 
> I'd be very happy to share.
>
> In general terms for model/form construction, I transform the original 
> spec it to something that jsonpickle can deliver into type().
>
> Can talk more if this sounds at all interesting.
>
> Cheers
>
> Chris.
>
> On Thursday, January 24, 2013 8:02:53 PM UTC, Adrian Andreias wrote:
>>
>> Hello,
>>
>> I need a way to define a django form through a yaml file (or another text 
>> format).
>> Is there some code that already does this?
>> I'm trying to not reinvent the wheel.
>>
>> I can't use simple python classes, since this would user input and would 
>> be a security risk and I need a simpler and limited format.
>>
>> Thanks
>>
>>

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




regex

2013-01-25 Thread arm
Hi,

I'm trying to figure out the regular expressions that will match any number 
and punctuation and chars like +,#,§ etc . Any advice?




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




Re: define form in yaml file

2013-01-25 Thread Tom Christie
Also, you might want to take a look at the Django Forms in an API 
world
 talk.
A large portion of that is about serializing form definitions into JSON, 
for use by both HTML and non-HTML clients. (eg mobile)
The project it talks about is 
here: https://github.com/WiserTogether/django-remote-forms
I don't think it does anything wrt. to the direction you need, of taking a 
serialized description and restoring a Form class from it, but it might 
give you some useful pointers all the same.

Cheers,

  Tom

On Thursday, 24 January 2013 20:02:53 UTC, Adrian Andreias wrote:
>
> Hello,
>
> I need a way to define a django form through a yaml file (or another text 
> format).
> Is there some code that already does this?
> I'm trying to not reinvent the wheel.
>
> I can't use simple python classes, since this would user input and would 
> be a security risk and I need a simpler and limited format.
>
> Thanks
>
>

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