Re: Best/Cleanest way to add fields to Class User in models.py?

2013-01-11 Thread Kashif Ali
I will suggest to create UserProfile model instead of customizing User
model. Add as many fields as you like in UserProfile model and use this new
model in your application wherever you are referencing User model.
You have todo some settings in your settings file in this regards.

Kashif


On Sat, Jan 12, 2013 at 12:06 PM, Saqib Ali  wrote:

>
> In my models.py, I use django.contrib.auth.models.User as a foreign key
> in many of the classes I created.
>
> The User class obviously has a lot of important features that any website
> developer will need to track and manage users to the website.
> However, I wish the class had three additional members -- all
> BooleanFields: myBoolA, myBoolB, myBoolC.
>
> What is the safest/cleanest/easiest/best way to achieve this
> functionality? Where should I add those members? It seems unwise to modify
> the Django source package itself.
>
>  --
> 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/-/FkW8DULxAFAJ.
> 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.
>



-- 
-Kashif

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



Best/Cleanest way to add fields to Class User in models.py?

2013-01-11 Thread Saqib Ali

In my models.py, I use django.contrib.auth.models.User as a foreign key in 
many of the classes I created.

The User class obviously has a lot of important features that any website 
developer will need to track and manage users to the website.
However, I wish the class had three additional members -- all 
BooleanFields: myBoolA, myBoolB, myBoolC.

What is the safest/cleanest/easiest/best way to achieve this functionality? 
Where should I add those members? It seems unwise to modify the Django 
source package itself.

-- 
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/-/FkW8DULxAFAJ.
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 Calendar App Just Like Google Calendar

2013-01-11 Thread Kashif Ali
Hello Guys,

Is there any django app available that is a replica of google calendar?
I have checked django-scheduler, django-swingtime and couple of more but
the hardest part with these apps/projects is the limited documentation.
Can anybody please guide me what app can serve my purpose?

Thanks,
Kashif

-- 
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: How do I display a static image in my index.html file?

2013-01-11 Thread Nikolas Stevenson-Molnar
Could you provide a bit more detail on the problem you're having?

_Nik

On 1/11/2013 8:12 PM, frocco wrote:
> I am still stuck.
>
> On Friday, January 11, 2013 3:20:40 PM UTC-5, frocco wrote:
>
> Hello,
>
> I am a newbie and cannot figure out how to do a simple image
> display that I currently do in PHP.
> I want to display a logo on my home page.
>
> I tried google, but am having no luck.
>
> 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/-/8g4-QNDvZdAJ.
> 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: How do I display a static image in my index.html file?

2013-01-11 Thread frocco
I am still stuck.

On Friday, January 11, 2013 3:20:40 PM UTC-5, frocco wrote:
>
> Hello,
>
> I am a newbie and cannot figure out how to do a simple image display that 
> I currently do in PHP.
> I want to display a logo on my home page.
>
> I tried google, but am having no luck.
>
> 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/-/8g4-QNDvZdAJ.
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: Need help configuring Apache production server on Raspberry PI to work with Django.

2013-01-11 Thread Nikolas Stevenson-Molnar
It goes in your Apache config file. Probably somewhere like
/etc/httpd/httpd.conf

_Nik

On 1/11/2013 5:10 PM, 7equivale...@gmail.com wrote:
> Hey guys, thanks for the help.
> (1 )I have confirmed mod-wsgi has been compiled against the correct
> version of python.
> (2) I have also confirmed mod-wsgi is in the list of loaded modules.
>
> My next question is what file do I place the WSGIScript directive in?
> I can't seem to find which file it goes in
>
>
>
> On Thursday, January 10, 2013 3:54:12 PM UTC-5, ke1g wrote:
>
> The apache configuration files must have, at a minimum, a
> WSGIScriptAlias directive.
>
> There is also a list of the apache modules which get loaded, and
> mod_wsgi must be included.
>
> mod_wsgi must be linked against the particular apache, but the
> distribution, if you're using the OS's package manager, should
> have made sure of that.
>
> As previously mentioned by another, mod_wsgi is linked against a
> particular python interpreter.  Again, hopefully the OS package
> manager pulls in stuff built to work together, but this does mean
> that you can't, say, use python2.7 if the distribution's python is
> a 2.6.
>
> It is much to be preferred, though not absolutely required, that
> the python in question was build after passing "--enable-shared"
> to the configure script.  Unless you build everything yourself
> (which I usually do, but not yet on Raspberry PI), you have no
> control of this.
>
> That WSGIScriptAlias directive should probably specify a
> python-path argument specifying the directory with manage.py in
> it, though I've seen it work with the adding of this path deferred
> to the wsgi script  python module.
>
> You can use a virtualenv, but it must have been made with the
> python interpreter against which mod_wsgi is linked (not the same
> file, but ve/bin/python is generally a copy, and this works well
> enough), but you will either need to use the WSGIPythonHome
> directive, or, if your mod_wsgi is new enough, the python-home
> argument of the WSGIScriptAlias directive.  (The advantage of the
> latter is the ability to use separate virtualenvs in separate
> VirtualHosts, whereas WSGIPytonHome is global across all mod_wsgi
> daemon processes under a single apache..)
>
> You will want to configure Alias directives to allow serving your
> STATIC and MEDIA files at the expected URLs.
>
> You will need a number of Directory directives (though fewer than
> some people think).
>
> The mod_wsgi documentation is excellent.  If you think otherwise
> it is because you don't yet appreciate the complexity of the issues.
>
> Bill
>
> On Thu, Jan 10, 2013 at 3:27 PM, <7equiv...@gmail.com
> > wrote:
>
> When you say "From there it should just be configuration." Do
> you mean either (1) Configuring mod-wsgi to work with apache,
> or (2) Configuring mod_wsgi to work with Django.
>
> The errors where involved with my first attempt at installing
> mod-wsgi according to the Django instructions, However now I'm
> using *sudo apt-get install libapache2-mod-wsgi *which is not
> mentioned in the Django docs. And step (3) seems to do
> whatever it does just fine with no errors.
>
> I'm not sure if I should be focusing on configuring mod-wsgi
> to work with apach or configuring mod-wsgi to work with
> Django. I'm sure there are steps for both that need to be
> taken
>
>
> On Thursday, January 10, 2013 2:53:35 PM UTC-5, Nikolas
> Stevenson-Molnar wrote:
>
> From there, it should just be configuration. What errors
> are you seeing?
>
> _Nik
>
> On 1/10/2013 10:59 AM, 7equiv...@gmail.com wrote:
> > Hello, I need help configuring the Apache production
> server to work
> > with Django on a Rapberry pi. I am still new to Linux.
> Here is what
> > I've done so far.
> >
> > (1) I have successfully installed Apache on my Raspberry
> pi. I have
> > used it to serve up php webpages.
> > (2) I have successfully installed Django on the RaspPi
> and created a
> > project that works with the Django development server.
> > (3) I have run the command ~$ sudo apt-get install
> libapache2-mod-wsgi
> >
> > I am unsure where to proceed after step 3. Did step 3
> install and
> > configure mod-wsgi to work with Apache, or do I still
> have some
> > initialization steps? Or, does the next step involve
> Django. I have
> > read and followed the steps from the Django website, but
> they produced
> > errors and where 

Re: Need help configuring Apache production server on Raspberry PI to work with Django.

2013-01-11 Thread 7equivalents
Hey guys, thanks for the help. 
(1 )I have confirmed mod-wsgi has been compiled against the correct version 
of python.
(2) I have also confirmed mod-wsgi is in the list of loaded modules.

My next question is what file do I place the WSGIScript directive in? I 
can't seem to find which file it goes in



On Thursday, January 10, 2013 3:54:12 PM UTC-5, ke1g wrote:
>
> The apache configuration files must have, at a minimum, a WSGIScriptAlias 
> directive.
>
> There is also a list of the apache modules which get loaded, and mod_wsgi 
> must be included.
>
> mod_wsgi must be linked against the particular apache, but the 
> distribution, if you're using the OS's package manager, should have made 
> sure of that.
>
> As previously mentioned by another, mod_wsgi is linked against a 
> particular python interpreter.  Again, hopefully the OS package manager 
> pulls in stuff built to work together, but this does mean that you can't, 
> say, use python2.7 if the distribution's python is a 2.6.
>
> It is much to be preferred, though not absolutely required, that the 
> python in question was build after passing "--enable-shared" to the 
> configure script.  Unless you build everything yourself (which I usually 
> do, but not yet on Raspberry PI), you have no control of this.
>
> That WSGIScriptAlias directive should probably specify a python-path 
> argument specifying the directory with manage.py in it, though I've seen it 
> work with the adding of this path deferred to the wsgi script  python 
> module.
>
> You can use a virtualenv, but it must have been made with the python 
> interpreter against which mod_wsgi is linked (not the same file, but 
> ve/bin/python is generally a copy, and this works well enough), but you 
> will either need to use the WSGIPythonHome directive, or, if your mod_wsgi 
> is new enough, the python-home argument of the WSGIScriptAlias directive.  
> (The advantage of the latter is the ability to use separate virtualenvs in 
> separate VirtualHosts, whereas WSGIPytonHome is global across all mod_wsgi 
> daemon processes under a single apache..)
>
> You will want to configure Alias directives to allow serving your STATIC 
> and MEDIA files at the expected URLs.
>
> You will need a number of Directory directives (though fewer than some 
> people think).
>
> The mod_wsgi documentation is excellent.  If you think otherwise it is 
> because you don't yet appreciate the complexity of the issues.
>
> Bill
>
> On Thu, Jan 10, 2013 at 3:27 PM, <7equiv...@gmail.com >wrote:
>
>> When you say "From there it should just be configuration." Do you mean 
>> either (1) Configuring mod-wsgi to work with apache, or (2) Configuring 
>> mod_wsgi to work with Django. 
>>
>> The errors where involved with my first attempt at installing mod-wsgi 
>> according to the Django instructions, However now I'm using *sudo 
>> apt-get install libapache2-mod-wsgi *which is not mentioned in the 
>> Django docs. And step (3) seems to do whatever it does just fine with no 
>> errors.
>>
>> I'm not sure if I should be focusing on configuring mod-wsgi to work with 
>> apach or configuring mod-wsgi to work with Django. I'm sure there are steps 
>> for both that need to be taken
>>
>>
>> On Thursday, January 10, 2013 2:53:35 PM UTC-5, Nikolas Stevenson-Molnar 
>> wrote:
>>
>>> From there, it should just be configuration. What errors are you seeing? 
>>>
>>> _Nik 
>>>
>>> On 1/10/2013 10:59 AM, 7equiv...@gmail.com wrote: 
>>> > Hello, I need help configuring the Apache production server to work 
>>> > with Django on a Rapberry pi. I am still new to Linux. Here is what 
>>> > I've done so far. 
>>> > 
>>> > (1) I have successfully installed Apache on my Raspberry pi. I have 
>>> > used it to serve up php webpages. 
>>> > (2) I have successfully installed Django on the RaspPi and created a 
>>> > project that works with the Django development server. 
>>> > (3) I have run the command ~$ sudo apt-get install libapache2-mod-wsgi 
>>> > 
>>> > I am unsure where to proceed after step 3. Did step 3 install and 
>>> > configure mod-wsgi to work with Apache, or do I still have some 
>>> > initialization steps? Or, does the next step involve Django. I have 
>>> > read and followed the steps from the Django website, but they produced 
>>> > errors and where confusing to me. 
>>> > 
>>> > Any help would be greatly appreciated! 
>>> > -- 
>>> > 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/-/**6SE8SJkDxf0J.
>>> >  
>>>
>>> > 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 
>>> > 

Re: Documentation of app_directories.Loader

2013-01-11 Thread Per-Olof Åstrand
Thanks for your feedback. It is exactly the way you suggest. I did not 
think through what I had done myself (referring to "app_name/*.html" in my 
views and templates) before posting.

Per-Olof

On Wednesday, January 9, 2013 1:50:17 AM UTC+1, Amirouche wrote:
>
> Héllo Per-Olof,
>
> On Saturday, January 5, 2013 4:17:14 PM UTC+1, Per-Olof Åstrand wrote:
>>
>> I had a problem interpreting the documentation of app_directories.Loader 
>> in 
>> https://docs.djangoproject.com/en/dev/ref/templates/api/#loading-templates(I 
>> use the dev version of Django). As I read the documentation, I should 
>> put the templates for an app in
>>
>> app_name/templates/*.html
>>>
>>
>>
> Yes, it should work if you reference the template *without* the app_name 
> for instance 
>
> {% extends "base.html" %}
> {% include "footer.html" %}
>
> or in python with «render(request, "base.html", ctx)» but you never render 
> the base html or footer directly so this is dummy example
>  
>
>> whereas to get it to work, I had to put them in
>>
>> app_name/templates/app_name/*.html
>>>
>>
>
> it only works if you reference the app_name when you call the template for 
> instance «render(request, "app_name/index.html", ctx)» same for include and 
> extends.
>
> It's a convention to avoid clash between templates names, it a way to 
> namespace templates, otherwise you would need to namespace the names of the 
> templates like: «app_name_index.html» which is not nice...
>
>
>> It also seems like it looks for templates in (which I could see from the 
>> error message when failing with the first approach)
>>
>> app_name1/templates/app_name2/*.html
>>
>>
>> I can see the power of that when having a hierarchy of apps. Am I missing 
>> something here?
>>
>> Per-Olof
>>
>

-- 
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/-/uKY3IySZbxsJ.
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: How do I display a static image in my index.html file?

2013-01-11 Thread @jeffblack360
Give this documentation a look:

https://docs.djangoproject.com/en/1.4/howto/static-files/

jb

On Friday, January 11, 2013 2:20:40 PM UTC-6, frocco wrote:
>
> Hello,
>
> I am a newbie and cannot figure out how to do a simple image display that 
> I currently do in PHP.
> I want to display a logo on my home page.
>
> I tried google, but am having no luck.
>
> 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/-/JE8LP3lt7XAJ.
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.



How do I display a static image in my index.html file?

2013-01-11 Thread frocco
Hello,

I am a newbie and cannot figure out how to do a simple image display that I 
currently do in PHP.
I want to display a logo on my home page.

I tried google, but am having no luck.

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



how to set template and media directory in settings?

2013-01-11 Thread frocco
Hello,

The line below does not work.
os.path.join(os.path.dirname(__file__),'templates'),

I see many references to doing it like above.

but if I create it like this, it works
PROJECT_PATH = os.path.join(os.path.dirname(__file__))
PROJECT_PATH + '/../templates',

What is the best way?
I am on Windows 7 and Mac

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/-/fJ9g8n7NBT4J.
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: Project Structure - Lots of scattered custom views

2013-01-11 Thread chad petzoldt
 Sanjay, you were hitting things pretty close. I think that making sure 
slug names match up to real *static* locations is the key. I am hosting 
with Apache, and I thought about using some configurations to cheat a 
little bit, and get some of the static-files burden off of Django and let 
Apache resolve any requests that point to actual files on disk (with some 
security in mind).

What about a view that can determine if it should be pointing at a file on 
disk, and if so, do a custom Http_Response, and read the actually binary 
contents from disk by hand. Im just curious on this one; it could be an 
alternative means of file storage and recognition. I understand this may 
have some performance implications, but this is not going to break Django, 
correct? Is this bad Django etiquette?

Amirouche, a different way to describe what I am trying to achieve might be 
this: I would like to bypass the admin as much as possible when it comes to 
these "Articles". But when rendered, all of these articles do need at least 
a small HTML wrapper, and probably some kind of of global template that 
helps with navigation. If I could handle navigation without the admin, i 
would be very excited, but it does seem that I will need to use the admin 
for at least this purpose. The navigation would probably help render 
hierarchical  "menus" for use as templates within the Articles. I would 
like to keep this navigation as light as possible.

Thanks for the feedback.

-- 
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/-/ja-o_pBFAT4J.
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: Custom jQuery in admin

2013-01-11 Thread Jim Thaxton
I'm not sure about your original problem but prefixing it with django will 
make use of Django's jquery namespace:
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-media-definitions

Django admin Javascript makes use of the jQuery  library. 
> To avoid conflicts with user-supplied scripts or libraries, Django's jQuery 
> is namespaced as django.jQuery. If you want to use jQuery in your own 
> admin JavaScript without including a second copy, you can use the 
> django.jQuery object on changelist and add/edit views.
> If you require the jQuery library to be in the global namespace, for 
> example when using third-party jQuery plugins, or need a newer version of 
> jQuery, you will have to include your own copy of jQuery.


On Friday, January 11, 2013 4:26:19 AM UTC-6, Daniele Procida wrote:
>
> I had a custom widget, which broke after some other things were updated. 
>
> It was saying: 
>
> TypeError: 'undefined' is not a function (evaluating '$('#id_conta 
> cts_and_people-phonecontact-content_type-object_id-0-label').combo 
> box()') 
>
> Last night, I finally managed to fix it, after noticing that this script 
> (which is injected into the HTML body as many times as required for each 
> widget) began: 
>
> $(document).ready(function(){ 
>
> while others I had seen began: 
>
> jQuery(document).ready(function($){ 
>
> Changing it to the latter form made it work. 
>
> The only thing is, I don't really understand what was wrong, or how doing 
> that fixed it. 
>
> I understand that a jQuery conflict of some kind meant that jQuery was 
> unable to find the function "combobox()" and that probably this was because 
> of the way the admin template was loading JavaScript files. 
>
> But I don't understand what the changes actually mean, or what they do. 
>
> I also found that: 
>
> django.jQuery(document).ready(function($){ 
>
> worked. Again, I don't know what that is doing. 
>
> If someone can explain what is going on in this example, that would be 
> really helpful. 
>
> More generally, this sort of thing (jQuery conflicts) seems to be an 
> almost constant issue for Django developers who create custom widgets. Is 
> there a more general strategy for dealing with it? 
>
> Thanks, 
>
> Daniele 
>
>

-- 
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/-/dd7dlwe4ZJcJ.
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: newbie needs to copy a record in admin to a new record

2013-01-11 Thread frocco
Thank you

[code]
def make_copy(modeladmin, request, queryset):
for obj in queryset:
obj.pk = None
obj.object_name = "dup"
obj.save()
make_copy.short_description = "Copy selected records"
[/code]

On Friday, January 11, 2013 10:53:02 AM UTC-5, Brad Pitcher wrote:
>
> I think what should work well for your use case is an admin action:
>
> https://docs.djangoproject.com/en/1.4/ref/contrib/admin/actions/
>
> You can write code for a copy action in admin.py. This will add a "copy" 
> item to the dropdown in the list view, so you can select any number of list 
> items and copy them.
>
> -
> Brad Pitcher
> Software Developer
> (702)723-8255
>
>
> On Fri, Jan 11, 2013 at 7:06 AM, frocco wrote:
>
>> Hello,
>>
>> I am just learning django and want to allow a user in admin to copy a 
>> record from the list to create a new record and make changes.
>> This will prevent having to type similar data.
>>  
>> How do I add a link to the admin list?
>> where do I put code to dup the record?
>>
>> Thank you 
>>
>> -- 
>> 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/-/odBD_lyCqmsJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/APP6hej_yGgJ.
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: storing large amounts of text in the DB

2013-01-11 Thread Mike


On Friday, January 11, 2013 7:47:18 AM UTC+1, Srinivas Reddy T wrote:
>
>
>
>
> On Fri, Jan 11, 2013 at 12:05 PM, Mike wrote:
>
>> My users will upload text documents ranging from hundreds to thousands of 
>> words.
>
> What kind of documents? pdf? word docs? excel?
>  
>
>>  At the moment I store the text in a TextField.  Is this going to cause a 
>> performance problem in the future or would it be better to store the text 
>> on the file system and put a file path in the data model?
>>
>  
> If you are uploading to a folder and storing the path in db, then when 
> somebody moves the folder, then you need to update the all the 
> corresponding paths in the database.When somebody deletes the folder, then 
> everything will be gone.You need to take care of handling duplicate names 
> too.
>
> Not a problem in this case because users will upload word, PDF and other 
docs, but I will extract the text content and discard the original file. 

Users will only see one document at a time so I'll follow Tim Chase's 
advise and assume its not an issue unless it becomes one in the future.

Thanks everyone for the replies.  I have to say I like this mailing list a 
lot.  It's a lot easier to ask questions here than on stack overflow.

-- 
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/-/-sXoQh4f7WcJ.
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: newbie needs to copy a record in admin to a new record

2013-01-11 Thread Brad Pitcher
I think what should work well for your use case is an admin action:

https://docs.djangoproject.com/en/1.4/ref/contrib/admin/actions/

You can write code for a copy action in admin.py. This will add a "copy"
item to the dropdown in the list view, so you can select any number of list
items and copy them.

-
Brad Pitcher
Software Developer
(702)723-8255


On Fri, Jan 11, 2013 at 7:06 AM, frocco  wrote:

> Hello,
>
> I am just learning django and want to allow a user in admin to copy a
> record from the list to create a new record and make changes.
> This will prevent having to type similar data.
>
> How do I add a link to the admin list?
> where do I put code to dup the record?
>
> Thank you
>
> --
> 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/-/odBD_lyCqmsJ.
> 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: Form validation

2013-01-11 Thread Kristofer
More details on the form and why there is a field that depends on 6 pages: 

In steps 2-5, I am prompting the user for questions and choices about a 
particular service. 

On page 6 they are given the opportunity to select a date/time for the service. 
The validation will calculate how how much time is required based on steps 2-5 
and see if the time they pick fits in the calendar. If it doesn't, it will ask 
them to pick a different time. 

I'm still not sure where I can use it, because I can't call 
get_cleaned_data_for_step from the forms validation/clean field, and I'm not 
sure where else I can access the required form steps and also be able to raise 
a validation error. 


- Original Message -

From: "Babatunde Akinyanmi"  
To: "Kristofer" , django-users@googlegroups.com 
Sent: Friday, January 11, 2013 8:05:59 AM 
Subject: RE: Form validation 

Hi, 
You can use the wizard's get_cleaned_data_for_step(step) method where step is 
0-indexed so step 2 form data would be: 
get_cleaned_data_for_step('1'). 
It would return a dictionary of the cleaned data for that step. 

Ignorable comment: I would be very pissed if I had to fill 6 form pages only to 
be told I can't continue because of something I did 4 pages ago. 

Sent from my Windows Phone 

From: Kristofer 
Sent: 1/11/2013 8:00 AM 
To: django-users@googlegroups.com 
Subject: Form validation 

Hello, 

I am using FormWizard with a 12-step form. 

On step 6, I want to perform verification on a field but it depends on fields 
that were entered in steps 2-5. 

I cannot figure out how to get data from the previous steps in the form 
validation for step 6. 

Where is a point in the FormWizard where I can access previous form data and 
can also raise ValidationError on a field? 

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



Looking for a Python/Django Developer

2013-01-11 Thread IT Recruiting Manager
We are currently seeking a Python/Django Developer in the Toronto Ontario 
area for contract work.

The initial contract is a 3 month contract with possibility of renewal. You 
are a Python developer with extensive experience using the Django 
framework. You also have experience with PHP preferably in a LAMP 
environment. If so, please send your resume for review.

Only local candidates will be considered for this position. No remote work.

-- 
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/-/z0UxalwlXa4J.
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 Formsets - How to build a formset correctly and validade it?

2013-01-11 Thread Andre Lopes
Hi all,

I'm struggling with Formsets. I've read the documentation and lots of
information on the web, but I'm experiencing some difficulties on get
them working.

I've wrote a StackOverflow question that explains my difficulties.

http://stackoverflow.com/questions/14280875/django-formsets-how-to-build-a-formset-correctly-and-validade-it

Can you give me some help on this one?

Best regards,
André

-- 
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: storing large amounts of text in the DB

2013-01-11 Thread Tim Chase

On 01/11/13 00:35, Mike wrote:

My users will upload text documents ranging from hundreds to
thousands of words.  At the moment I store the text in a
TextField.  Is this going to cause a performance problem in the
future or would it be better to store the text on the file
system and put a file path in the data model?  The text does not
need to be indexed and I'm using MySQL.


If it doesn't need to be indexed (by which I also assume that you're 
not searching by its contents), that's actually a pretty small 
quantity of data to stash in a TEXT field.  So it should pose no 
problem.  The only other issue might be if you have cases where you 
bring back large quantities of these fields and try to display, in 
which case you're pulling N records time M 
average-bytes-per-text-record.  But usually users don't want to see 
that sort of volume of data.



I suppose the best way is to profile the app and see if the text
retrieval is a bottleneck but I thought someone on this list
would already have experience in this.


I'd code under the assumption that it's not an issue, and then 
profile if it becomes one.


-tkc


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



newbie needs to copy a record in admin to a new record

2013-01-11 Thread frocco
Hello,

I am just learning django and want to allow a user in admin to copy a 
record from the list to create a new record and make changes.
This will prevent having to type similar data.

How do I add a link to the admin list?
where do I put code to dup the record?

Thank you 

-- 
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/-/odBD_lyCqmsJ.
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's your opinion about nested apps?

2013-01-11 Thread Sergiy Khohlov
 keep in mind comas

INSTALLED_APPS = (

'incidences',
'problems',
)
2013/1/11 David Medina :
> INSTALLED_APPS = (
> 'trouble_ticketer',
> 'trouble_ticketer.incidences'
> 'trouble_ticketer.problems'
> )



Many thanks,

Serge


+380 636150445
skype: skhohlov

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



What's your opinion about nested apps?

2013-01-11 Thread David Medina
I mean...

*[Dir structure]*
trouble_ticketer/
models.py
views.py
incidences/
 models.py
 views.py
problems/
 models.py
 views.py

*[settings.py]*
INSTALLED_APPS = (
'trouble_ticketer',
'trouble_ticketer.incidences'
'trouble_ticketer.problems'
)

*[imports and app]*
from django.db.models import get_app

get_app('incidences')
> module 'trouble_ticketer.incidences.models.py' ...

import incidences
> Import Error

from app1 import incidences


PD: I don't totally understand the process of Django app loading
PD2: Excuse my English level

-- 
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/-/cVwCzqJKsvYJ.
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: storing large amounts of text in the DB

2013-01-11 Thread Sreenivas Reddy T
On Fri, Jan 11, 2013 at 12:05 PM, Mike  wrote:

> My users will upload text documents ranging from hundreds to thousands of
> words.

What kind of documents? pdf? word docs? excel?


>  At the moment I store the text in a TextField.  Is this going to cause a
> performance problem in the future or would it be better to store the text
> on the file system and put a file path in the data model?
>

If you are uploading to a folder and storing the path in db, then when
somebody moves the folder, then you need to update the all the
corresponding paths in the database.When somebody deletes the folder, then
everything will be gone.You need to take care of handling duplicate names
too.

Having said that.Serving from database is very slower  than serving the
documents from a folder.

Just my 2 cents.


>  The text does not need to be indexed and I'm using MySQL.  I suppose the
> best way is to profile the app and see if the text retrieval is a
> bottleneck but I thought someone on this list would already have experience
> in this.
>
>  --
> 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/-/5CA4p7wHPmoJ.
> 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: Form validation

2013-01-11 Thread Babatunde Akinyanmi
Hi,
You can use the wizard's get_cleaned_data_for_step(step) method where step
is 0-indexed so step 2 form data would be:
get_cleaned_data_for_step('1').
It would return a dictionary of the cleaned data for that step.

Ignorable comment: I would be very pissed if I had to fill 6 form pages
only to be told I can't continue because of something I did 4 pages ago.

Sent from my Windows Phone
--
From: Kristofer
Sent: 1/11/2013 8:00 AM
To: django-users@googlegroups.com
Subject: Form validation

Hello,

I am using FormWizard with a 12-step form.

On step 6, I want to perform verification on a field but it depends on
fields that were entered in steps 2-5.

I cannot figure out how to get data from the previous steps in the form
validation for step 6.

Where is a point in the FormWizard where I can access previous form data
and can also raise ValidationError on a field?

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.
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: Correct way to specifiy database-level column defaults

2013-01-11 Thread akaariai
On 10 tammi, 16:04, john.wolt...@tpiengineering.com wrote:
> What is the best way to specify a database level default value with
> Django?  If I want a timestamp column to default to the SQL function now(),
> is there an accepted way to make it happen?  Or to default a boolean column
> to True?  I notice that when I call *manage.py sqlall* I don't see any *
> DEFAULT* values specified in the generated queries for Postgres.

Support for this would be an useful addition. Personally I have need
for at least now() and txid_current(), but preferably we want any
default clause (maybe even any per column SQL, so that you could do
CHECK too).

There are three problems for this feature:
  1. How to get the SQL into the CREATE TABLE clauses?
  2. How to return the values back after insert?
  3. If the way for no.1 is hand edited SQL, how to support this in
testing?

Above, no.2 seems the hardest problem. Some databases support
RETURNING, but not all.

Currently, you can do DB defaults by hand editing the sqlall output +
using post_save signal() and fetch the DB generated values into the
saved instance in the signal. But, you will need some way to solve no.
3 in this case. South might be a good option here. Personally I use a
custom testing system where I load the database schema from production
(with some data, too), apply migrations (that is, load custom SQL) and
then run tests.

 - Anssi

-- 
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: Don't be afraid to commit - a free Python/Django workshop (Cardiff, UK)

2013-01-11 Thread Iñigo Medina

> What we'll cover
> 
> 
> The workshop will take participants through the complete cycle of identifying
> a simple issue in a Django or Python project, writing a patch with tests and
> documentation, and submitting it.
> 
> The workshop will take you through the use of:
> 
> * virtualenv and pip
> * git (and GitHub)
> * running and writing tests for Python applications
> * writing and building documentation using Sphinx
> * submitting a pull request
> 

All sounds great. It might be also useful some examples on real _first_
contribute commits.

Iñigo

> 
> 
> -- 
> 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: DateTimeField received a naive datetime (2013-01-10 00:00:00) while time zone support is active.

2013-01-11 Thread Iñigo Medina
On Fri, Jan 11, 2013 at 12:23:17AM -0800, Jeff Hsu wrote:
> Hi all,
> 
>I kept getting DateTimeField received a naive datetime (2013-01-10 
> 00:00:00) while time zone support is active. but I can't figure out where 
> it's receiving a naive datetime.  I have USE_TZ set to True in my setting 
> file(stores timezone aware object in mysql?).  My url is as below:

You get some good tips for configuration and tracebak on this post:
http://note.harajuku-tech.org/datetimefield-received-a-naive-datetime-while

Iñigo


> 
> -- 
> 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/-/q3z2y6RI3x4J.
> 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: Custom jQuery in admin

2013-01-11 Thread Mario Gudelj
Sounds like you have something else on that page using $, such as prototype
library. Look up jquery's noconflict() if that's the case
On 11 Jan, 2013 9:26 PM, "Daniele Procida"  wrote:

> I had a custom widget, which broke after some other things were updated.
>
> It was saying:
>
> TypeError: 'undefined' is not a function (evaluating '$('#id_conta
> cts_and_people-phonecontact-content_type-object_id-0-label').combo
> box()')
>
> Last night, I finally managed to fix it, after noticing that this script
> (which is injected into the HTML body as many times as required for each
> widget) began:
>
> $(document).ready(function(){
>
> while others I had seen began:
>
> jQuery(document).ready(function($){
>
> Changing it to the latter form made it work.
>
> The only thing is, I don't really understand what was wrong, or how doing
> that fixed it.
>
> I understand that a jQuery conflict of some kind meant that jQuery was
> unable to find the function "combobox()" and that probably this was because
> of the way the admin template was loading JavaScript files.
>
> But I don't understand what the changes actually mean, or what they do.
>
> I also found that:
>
> django.jQuery(document).ready(function($){
>
> worked. Again, I don't know what that is doing.
>
> If someone can explain what is going on in this example, that would be
> really helpful.
>
> More generally, this sort of thing (jQuery conflicts) seems to be an
> almost constant issue for Django developers who create custom widgets. Is
> there a more general strategy for dealing with it?
>
> Thanks,
>
> Daniele
>
> --
> 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.



Custom jQuery in admin

2013-01-11 Thread Daniele Procida
I had a custom widget, which broke after some other things were updated.

It was saying:

TypeError: 'undefined' is not a function (evaluating '$('#id_conta
cts_and_people-phonecontact-content_type-object_id-0-label').combo
box()')

Last night, I finally managed to fix it, after noticing that this script (which 
is injected into the HTML body as many times as required for each widget) began:

$(document).ready(function(){

while others I had seen began:

jQuery(document).ready(function($){

Changing it to the latter form made it work.

The only thing is, I don't really understand what was wrong, or how doing that 
fixed it.

I understand that a jQuery conflict of some kind meant that jQuery was unable 
to find the function "combobox()" and that probably this was because of the way 
the admin template was loading JavaScript files. 

But I don't understand what the changes actually mean, or what they do.

I also found that:

django.jQuery(document).ready(function($){ 

worked. Again, I don't know what that is doing.

If someone can explain what is going on in this example, that would be really 
helpful.

More generally, this sort of thing (jQuery conflicts) seems to be an almost 
constant issue for Django developers who create custom widgets. Is there a more 
general strategy for dealing with it?

Thanks,

Daniele

-- 
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: storing large amounts of text in the DB

2013-01-11 Thread Mike


On Friday, January 11, 2013 9:30:39 AM UTC+1, iñigo medina wrote:
>
>
> El 11/01/2013 07:36, "Mike"  escribió:
> >
> > My users will upload text documents ranging from hundreds to thousands 
> of words.  At the moment I store the text in a TextField.  Is this going to 
> cause a performance problem in the future or would it be better to store 
> the text on the file system and put a file path in the data model?  The 
> text does not need to be indexed and I'm using MySQL.
>
> That depends pretty much on the operations you perform over such field. 
> Fetch? Search? Concurrence updates?
>
> Iñigo
>
>
> I need to fetch but not search or update.  I guess this is pretty much 
case specific so I don't need to worry about it now, but if I run into 
performance problems in the future, this may be the first place to look. 

-- 
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/-/tthe_mfhKaUJ.
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: DateTimeField received a naive datetime (2013-01-10 00:00:00) while time zone support is active.

2013-01-11 Thread Tom Evans
On Fri, Jan 11, 2013 at 8:23 AM, Jeff Hsu  wrote:
> Hi all,
>
>I kept getting DateTimeField received a naive datetime (2013-01-10
> 00:00:00) while time zone support is active. but I can't figure out where
> it's receiving a naive datetime.  I have USE_TZ set to True in my setting
> file(stores timezone aware object in mysql?).  My url is as below:
>
> urlpatterns = patterns('django.views.generic.date_based', #add the
> repetitive pattern here
> url(r'^$', 'archive_index', entry_info_dict,
> name='coltrane_entry_archive_index'),
> url(r'^(?P\d{4})/$','archive_year', entry_info_dict,
> name='coltrane_entry_archive_year'),
> url(r'^(?P\d{4})/(?P\w{3})/$','archive_month',
> entry_info_dict,
> name='coltrane_entry_archive_month'),
> url(r'^(?P\d{4})/(?P\w{3})/(?P\d{2})/$','archive_day',
> entry_info_dict,
> name='coltrane_entry_archive_day'),
>
> url(r'^(?P\d{4})/(?P\w{3})/(?P\d{2})/(?P[-\w]+)/$',
> 'object_detail', entry_info_dict, name='coltrane_entry_detail'),
> #the forth arg will this patter a name
>  #[-\w] will match letter, number or a hyphen
> )
>
> Every time I access a detail page from the archive index page, the error
> will pop out.  I'm using generic view to do my detail page, and I can figure
> out what's wrong.  Can anybody give me some direction?
>
> http://dpaste.com/871999/
>
> Thank you,
> Jeff
>

Function based generic views were deprecated in 1.3, TZ support
appeared in 1.4.

When a date based generic view is asked to filter against a
DateTimeField, it takes the specified day, and filters that field is
between datetime.combine(date, time.min) and datetime.combine(date,
time.max). datetime.combine only returns TZ aware datetimes if the
time supplied is TZ aware (time.min/time.max are not).

I suggest you update to use the class based generic views that arrived in 1.3:

https://docs.djangoproject.com/en/1.4/topics/generic-views-migration/

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: storing large amounts of text in the DB

2013-01-11 Thread iñigo medina
El 11/01/2013 07:36, "Mike"  escribió:
>
> My users will upload text documents ranging from hundreds to thousands of
words.  At the moment I store the text in a TextField.  Is this going to
cause a performance problem in the future or would it be better to store
the text on the file system and put a file path in the data model?  The
text does not need to be indexed and I'm using MySQL.

That depends pretty much on the operations you perform over such field.
Fetch? Search? Concurrence updates?

Iñigo

>
> --
> 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/-/5CA4p7wHPmoJ.
> 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: Form validation

2013-01-11 Thread iñigo medina
El 11/01/2013 08:00, "Kristofer"  escribió:
>
>
> On step 6, I want to perform verification on a field but it depends on
fields that were entered in steps 2-5.

Do you save such data anywhere (database, session...)? You might get from
this source and use as you need.

Iñigo

>
> I cannot figure out how to get data from the previous steps in the form
validation for step 6.
>
> Where is a point in the FormWizard where I can access previous form data
and can also raise ValidationError on a field?
>
> 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.
> 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.



DateTimeField received a naive datetime (2013-01-10 00:00:00) while time zone support is active.

2013-01-11 Thread Jeff Hsu
Hi all,

   I kept getting DateTimeField received a naive datetime (2013-01-10 
00:00:00) while time zone support is active. but I can't figure out where 
it's receiving a naive datetime.  I have USE_TZ set to True in my setting 
file(stores timezone aware object in mysql?).  My url is as below:

urlpatterns = patterns('django.views.generic.date_based', #add the 
repetitive pattern here
url(r'^$', 'archive_index', entry_info_dict, 
name='coltrane_entry_archive_index'),
url(r'^(?P\d{4})/$','archive_year', entry_info_dict, 
name='coltrane_entry_archive_year'),
url(r'^(?P\d{4})/(?P\w{3})/$','archive_month', 
entry_info_dict, 
name='coltrane_entry_archive_month'),

url(r'^(?P\d{4})/(?P\w{3})/(?P\d{2})/$','archive_day', 
entry_info_dict, 
name='coltrane_entry_archive_day'),

url(r'^(?P\d{4})/(?P\w{3})/(?P\d{2})/(?P[-\w]+)/$',
'object_detail', entry_info_dict, name='coltrane_entry_detail'), 
#the forth arg will this patter a name
 #[-\w] will match letter, number or a hyphen
)

Every time I access a detail page from the archive index page, the error 
will pop out.  I'm using generic view to do my detail page, and I can 
figure out what's wrong.  Can anybody give me some direction?

http://dpaste.com/871999/

Thank you,
Jeff

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



Don't be afraid to commit - a free Python/Django workshop (Cardiff, UK)

2013-01-11 Thread Daniele Procida
I have made a combined talk/workshop proposal for DjangoCon Europe in May (all 
proposals at ).

I want to run the workshop part a couple of times before taking it to Warsaw 
(assuming the proposal is accepted, but it's worth doing anyway). 

The workshop is free and open to anyone - so if you're interested and within 
reach, let me know. 

=
Don't be afraid to commit
=

A hands-on workshop for Python/Django developers who would like to contribute
more to the projects they use, but need more grounding in some of the tools
required.

What's in it for you


As well as helping to put you in a position to commit successfully to
collaborative projects, the workshop's emphasis on using virtualenv/pip and
git will help you manage your own work in a more streamlined and efficient
way.

The automated testing tutorial - the most substantial component of the workshop
- will help you develop your software faster, better and more easily.

What we'll cover


The workshop will take participants through the complete cycle of identifying
a simple issue in a Django or Python project, writing a patch with tests and
documentation, and submitting it.

The workshop will take you through the use of:

* virtualenv and pip
* git (and GitHub)
* running and writing tests for Python applications
* writing and building documentation using Sphinx
* submitting a pull request

A workbook and reference guide will be provided to support the workshop.

What you need to know
=

The workshop is open to anyone, but places will be limited.

Date: a weekday morning or afternoon in February or March 2012
Venue: Cardiff University
Attendance fee: none

Let me know if you'd like to attend!

Daniele


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