Re: FileField fieldRequired error

2006-05-01 Thread layik

I really appreciate all that you say! I am sorry just realised I
typed in capital letters.

I really tried more than 10 combinations, searched for all possible
keywords here, tried all the documentations, compared my produced HTML
with some from the admin one I have and this is what I get for HTML so
far:

File: <


(the manipulator error message)*** This field is required. as soon as I
click on the submit button!

once again, 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: FileField fieldRequired error

2006-05-01 Thread layik


layik wrote:
> Hi,
>
> I have read this thread:
> http://groups.google.com/group/django-users/browse_frm/thread/399360004a8d0716/d6d355feecef7f7a?q=filefield+error=6#d6d355feecef7f7a
>
>
> please help me to use those two {{form.field}}{{form.field_file}} when
> I do my template!
>
> do I creat two differnet lables? do I put them both in one lable
> together?
>
> currently I use only {{form.field_file}} so the fileExplorer widget is
> there but when I click on submit button it gives me the error of "this
> field is required" although I DO selet a file.
> 
> please help! thanks

once again PLEASE HELP ME!


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



Re: FileField fieldRequired error

2006-05-01 Thread layik


layik wrote:
> Hi,
>
> I have read this thread:
> http://groups.google.com/group/django-users/browse_frm/thread/399360004a8d0716/d6d355feecef7f7a?q=filefield+error=6#d6d355feecef7f7a
>
>
> please help me to use those two {{form.field}}{{form.field_file}} when
> I do my template!
>
> do I creat two differnet lables? do I put them both in one lable
> together?
>
> currently I use only {{form.field_file}} so the fileExplorer widget is
> there but when I click on submit button it gives me the error of "this
> field is required" although I DO selet a file.
> 
> please help! thanks

once again PLEASE HELP ME!


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



FileField fieldRequired error

2006-05-01 Thread layik

Hi,

I have read this thread:
http://groups.google.com/group/django-users/browse_frm/thread/399360004a8d0716/d6d355feecef7f7a?q=filefield+error=6#d6d355feecef7f7a


please help me to use those two {{form.field}}{{form.field_file}} when
I do my template!

do I creat two differnet lables? do I put them both in one lable
together?

currently I use only {{form.field_file}} so the fileExplorer widget is
there but when I click on submit button it gives me the error of "this
field is required" although I DO selet a file.

please help! 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: How can users only edit their own files?

2006-05-01 Thread layik

Hi Olive,
I couldnt do that, anywhere I can find more help about that?

the notes seem to be too difficult for me, I would need more help on
those, coz I have two types of staff who do differnet things.

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: How can users only edit their own files?

2006-05-01 Thread layik

Thanks Max & James,

that did it.

I was terrified and I couldnt do any work yesterday, I should have come
back here soon after.


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



Re: superuser permission by non-superuser!

2006-04-30 Thread layik

Thanks Adrian,

this helps me document my work better as well.


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



Re: How can users only edit their own files?

2006-04-30 Thread layik

I am scared now Luke

How am I going to avoid this? I sign out from Django but I still can
see this:
http://localhost:8000/admin/auth/users/4/

That is going to KILL my project!

PLEASE help!


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



superuser permission by non-superuser!

2006-04-30 Thread layik

Am I missing something or Django 0.91 that I have has got a little bug
in the persmissions?!

I have some users, one of them is a service admin but I have given
permissions to him to be able to add, change and delete users from
Django's standard user model.

when I sign in using that service admin account, I can make myself a
super-user and in deed sign up as my as I want as super-users!!

anyone agrees?


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



Re: help with manipulators

2006-04-09 Thread layik

# Do a post-after-redirect so that reload works, etc.
return HttpResponseRedirect("/docs/%i/" % place.id)  # just
corrected this claimdoc.id


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



help with manipulators

2006-04-09 Thread layik

my model:

class claimdoc(meta.Model):
description = meta.CharField(maxlength=30,core = True)
claim = meta.ForeignKey(Claim, edit_inline=meta.TABULAR,
num_in_admin = 3)
date = meta.DateField('Date Submitted')
name = meta.FileField(upload_to="claims/docs")

# Claim is another model for which I add documents

my custom manipulator:
class fileManipulator(formfields.Manipulator):
def __init__(self):
self.fields = (
formfields.TextField =
(field_name="description",maxlength=30,is_required=True),
formfields.ForeignKey(field_name="claim",Claim,
edit_inline=meta.TABULAR, num_in_admin = 3,is_required=True)#??!
formfields.DateField(field_name="date",'Date
Submitted',is_required=True),


formfields.FileField(field_name="name",upload_to="claims/docs",validator_list=[self.validate_filesize],is_required=True),

)
def validate_filesize(self, field_data, all_data):
if len(field_data["content"] > 5000): # 5,000 bytes
   raise validators.ValidationError, "Please enter a
smaller file"


#the view for a new claimdoc
def claimdoc_form(request):
manipulator = fileManipulator()
if request.POST:
new_data = request.POST.copy()
errors = manipulator.get_validation_errors(new_data)

if not errors:
manipulator.do_html2python(new_data)

# create the new object here
manipulator.save(new_data)
# save file to the appropriate folder
upload_file(request)

# Do a post-after-redirect so that reload works, etc.
return HttpResponseRedirect("/docs/%i/" % place.id)

else:
errors = new_data = {}
form = formfields.FormWrapper(manipulator, new_data, errors)
return render_to_response('claimdoc_form', {'form': form})

upload_file(request):
#this code has no error in it


my questions:
1. where do I get the right formfields type for the proper model
attribute types, for example how do I know will it be a TextField or a
LargeTextField??

2. I dont wnat my users to see my foreign key obviously, before saving
the new object how can I insert the CORRECT foreign key value into the
manipulator?

3. please correct my mistakes if you can!

I DO NEED HELP, PLEASE!

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: adding a validator

2006-04-03 Thread layik

I have also read all posts related to a validator here


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



adding a validator

2006-04-03 Thread layik

I have read the validator documents

please help me with steps of adding a validator to my FileField.

where do I start? I dont know where to put somthing similar to this
example into my class,
http://www.djangoproject.com/documentation/forms/#Validators

and where to put each bit!

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: OneToOneField

2006-03-29 Thread layik

Hello there,

sorry to bother you.

I was wondering if you have solved your OneToOne problem. if so could
let me know how I could solve it as well??
thanks


ChaosKCW wrote:
> Agreeded, I am trying to use OneToOne in MR branch and get the same
> problems.
>
> I have:
>
> class Employee(models.Model):
>user = models.OneToOneField(User, verbose_name='Employees User ID')
>...
>
> And get the following error when trying to view the object in admin:
>
> Request Method:   GET
> Request URL:  http://127.0.0.1:8000/admin/traininglog/employee/
> Exception Type:   OperationalError
> Exception Value:  no such column: auth_user.username
> Exception Location:
>   
> c:\programming\python24\lib\site-packages\django-0.91-py2.4.egg\django\db\backends\sqlite3\base.py
> in execute, line 62
> 
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: OneToOneField

2006-03-29 Thread layik

might be a too late reply but could any of you tell me what MR Branch
or svn Trunk that you are tlkaing about is?

I am sorry I dont know any of them.

I still have the problem unsolved.

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: OneToOneField

2006-03-21 Thread layik

please help!


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



FileField not uploading

2006-03-21 Thread layik

Hi all,
I am using:

Windows xp
Django 0.91
Django's own development server.

myproject/
...myapp
...media
../myapp
./uploads

in my settings

# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = 'C:/absolute_file_path/media'

# URL that handles the media served from MEDIA_ROOT.
MEDIA_URL =  'http://mywebsite.com/media'

in my model

file = meta.FileField (upload_to ="/myapps/uploads")

QUESTION 1:
when I add a new object it says added successfully but I check
myapps/uploads and there is no file uploaded!!!

AND
QUESTION2: are these true understandings of MEDIA_ROOT and MEDIA_URL???

I understand the process (through this user group posts) as:
1.Django uses MEDIA_ROOT as the filePath point to resort to for finding
where to upload files to each apps using the upload_to option

2. for retrieving these files, it uses the MEDIA_URL as the filePath
point to resort to for finding from where to serve the requested files
using the full_file_path from the model's "file" field


THANKS FOR YOUR TIME!

P.S:I cannot finish my project with anything else but Django.


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



Re: OneToOneField

2006-03-21 Thread layik

Kenneth Gonsalves wrote:
> On Tuesday 21 Mar 2006 5:52 am, layik wrote:
> > Class member:
> > username = meta.foreignKey (users)
> > email = charfield
>
> this is not onetoone
> --
> regards
> kg
>
> http://www.livejournal.com/users/lawgon
> tally ho! http://avsap.org.in
> ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!

that was 2AM, I did mean meta.OneToOneField(users)

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



Re: OneToOneField

2006-03-20 Thread layik


bruno desthuilliers wrote:
> layik wrote:
> > is the bug fixed?
>
> Which one ? and in which version ?
>
> > I didnt quite understand the previous topics.
> > could anyone please tel me what I need to be aware of when trying to
> > extend tables and using OneToOneField
> >
> > many thanks
> >
> >
> >
> >
> >
>
>
> --
> bruno desthuilliers
> développeur
> [EMAIL PROTECTED]
> http://www.modulix.com

sorry, I am using 0.91,
I was reading some posts regardin A bug in it and I was reading it is
now fixed but I wasnt sure which one either!

my problem with 1to1 is:
Class user:
username (UNIQUE)

Class member:
username = meta.foreignKey (users)
email = charfield


in my_view:
u = user.get_object(pk=1)
m = u.get_member() <<= error: table user has no attribute member
m = member.get_object(username__exact= "me")<<= error: table user
has no attribute username

does it work for anyone? am I doing the wrong thing? will it work if I
do it the other way??

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



OneToOneField

2006-03-19 Thread layik

is the bug fixed? I didnt quite understand the previous topics.
could anyone please tel me what I need to be aware of when trying to
extend tables and using OneToOneField

many 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Apache vs. Django ?

2006-03-15 Thread layik

Hi Ian,

I have what you say there, and I get the error message of:

EnvironmentError: Could not import DJANGO_SETTINGS_MODULE
'myproject.settings' (is it on sys.path?): No module named
myproject.settings


please help!


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



Re: login page

2006-03-10 Thread layik

I am happy to tell anyone who is trying to do the same mistake I was
doing for the past day probably!! that, forms are loaded empty for
something to be put in them and then PROCESSED accordingly.

I was trying to LOAD and PROCESS the form together. so the order is:
direct browser to LOAD the login_form, THEN in the ACTION direct the
browser to PROCESS the form.


BUT now I have another problem...

why i cannot sign anyone in? i hav created users who are NOT staff and
users who are staff and a superuser as well. using the code I had
mentioned early with my development server should I be able to sign in?

in my view I have these: first to load the log in form, i direct the
browser here =>
#clean up and test cookies
def login(request):
if request.POST:
if request.session.test_cookie_worked():
request.session.delete_test_cookie()
return HttpResponse("You're logged in.")
else:
return HttpResponse("Please enable cookies and try again.")
request.session.set_test_cookie()
return render_to_response('claims/login_form')

THEN TO PROCESS THE FORM =>
def dologin(request):
m = users.get_object( username__exact = request.POST['username'] )
if m.password == request.POST['password']:
request.session['user_id'] = m.id
return HttpResponse("You're logged in.")
else:
return HttpResponse("Your username and password didn't match.")


I ALWAYS get the didnt match response!

any clues

many 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: login page

2006-03-10 Thread layik


Luke Plant wrote:
> > 
> > Enter Username: 
> > Enter Password: 
> > 
>
> You've duplicated 'username' there - it might be your problem (though
> it seems unlikely actually).  Also make sure there isn't any
> redirection going on.  You can check easily if you are running the
> development server by looking at the output on the console.

thats right, I corrected that , as that was a copy from a previous
attempt.

but still I get the same error message.

I am running the development server. I know little about its
limitations though.

> Also, just to mention on the *args and **kwargs front - you don't
> actually have to modify that bit in the example given in the docs.  The
> *args and **kwargs are real syntax, not meta-syntax that you have to
> replace.
>
> Luke

thanks for that, and THANKS Eric for all those examples, YES they help!

for my POST method and GET problem, I havent got a clure either! You
just made me notice that!

:(


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



login page

2006-03-10 Thread layik

Hi all,

I am doing well with django so far.I am doing my final year project and
I am a couple of weeks behind my schedule, so please help me.

1. I am trying to use the code from the sessions documentation for a
login view, which is:
http://www.djangoproject.com/documentation/sessions/#examples

I get the error of:

MultiValueDictKeyError at /claims/login/
"Key 'username' not found in "
Request Method: GET
Request URL: http://localhost:8000/claims/login/
Exception Type: MultiValueDictKeyError
Exception Value: "Key 'username' not found in "

my login.html form, is simple form:


Enter Username: 
Enter Password: 


my url.py:
..

   (r'^login/$', 'myProject.myApp.views.login'),


2. Adrian says, to limit the access to generic_views for logged in
users he points us to here
http://www.djangoproject.com/documentation/authentication/#limiting-access-to-generic-views

this might be stupid to ask but I dont know what (*args) and (**kwargs)
mean at all!

thanks in advance


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



Re: Help with Django base template and CSS

2006-03-05 Thread layik


thebubblejungle wrote:
> You might be able to fix that by using myapp/BaseOrAnotherTemplate. I
> managed to get that part working! Also, if you have a setup like
> /templates/myapp/ this is why it maybe can't find the file.

my directory structure is exactly that way. But it still doesnt accept
it!

> My urls.py file is:
>
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('ourproject.leaguemanager.views',
> (r'^admin/', include('django.contrib.admin.urls.admin')),
> (r'^$', 'index'),
>
> (r'^results/(?P\d+)/(?P\d+)/(?P\d+)/$',
> 'results'), #by league, season, division
> (r'^media/(?P.*)$', 'django.views.static.serve',
> {'document_root': "J:/University of
> Leeds/se12/project/ourproject/media", 'show_indexes': True}),
> )


I am studying at the university of Leeds, TOO. But I am FAR LESS
skilled in all this. and Django is my first Web Development experience.

> I've decoupled the URLs as mentioned in the documentation. But, is that
> pattern being appended to django.views.static.serve also?
> 
> m

I wish I could help you!


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