Re: Off-line Django apps / Caching and synchronizing data

2012-05-27 Thread ALJ
Thanks for the link Marcin. To anyone else interested in looking into this, it looks like the first stop is to read Mark Pilgrim's chapter "Let's Take This Offline " in "Dive Into HTML5". -- You received this message because you are subscribed to

Re: Off-line Django apps / Caching and synchronizing data

2012-05-26 Thread ALJ
Hi Andy, Cheers for that. I'll start looking at some JS/HTML5 frameworks. ALJ -- 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/-/HNImAOZO9

Off-line Django apps / Caching and synchronizing data

2012-05-24 Thread ALJ
s and I haven't seen any artifacts they currently use or what they were hoping to get out of it, but any pointers would be great. Thanks ALJ -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web vis

unique_together where one of the fields may be NULL

2012-03-12 Thread ALJ
r two identical values into the database via the Admin interface where the budget and years are the same while the sales_rep is empty. I have seen some discussion on it in the archives, but wondered if there is a work around. Cheers ALJ >>>>>>>>>>>>>>&

Re: More than one project using the same database

2011-07-01 Thread ALJ
itions. Cheers ALJ -- 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 opt

Re: More than one project using the same database

2011-06-30 Thread ALJ
Hi Andres, that's what I was hoping was the case. I just wasn't sure. ALJ On Jun 30, 1:53 pm, andres.osin...@gmail.com wrote: > In theory, unless you've disabled transactions, the database should be able > to manage all contention issues. > Enviado desde mi Blac

More than one project using the same database

2011-06-30 Thread ALJ
think about (are race issues one?), is it possible to detect if these issues could occur in my particular situation, and how do you mitigate against these. ALJ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Problem reversing urls when calling templates from another project

2011-05-20 Thread ALJ
ok ... still struggling. While in Public_site.views I can call functions from within the Extranet_site.views ... but I can't even do a: return HttpResponseRedirect(reverse('Extranet_site.application_name.views.function_name', args=(999,))) Within my Public_site.settings I have installed Extranet

Re: Problem reversing urls when calling templates from another project

2011-05-20 Thread ALJ
@Shawn Cheers. I'm such a c*ck. I am so used to using named URL patterns that I just assumed that that was how you did it. So yes, I've had a look at the documentation, although still struggling to get it to find the reverse, even when using the full path. -- You received this message because you

Problem reversing urls when calling templates from another project

2011-05-20 Thread ALJ
I have two projects that work together. Lets call them Extranet_site and Public_site. Most of the functionality was developed for Extranet_site, but we wanted to capture requests from the public, so we set up Public_site and then just attached to some of the functionality in Extranet_site. A scena

Re: Encrpting urls to hide PKs

2011-05-10 Thread ALJ
Some interesting stuff here. The short URL generator looks interesting. But yes, I appreciate the thoughts about security. Horses for courses and all that. Cheers ALJ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Encrpting urls to hide PKs

2011-05-09 Thread ALJ
't critical and not worth the effort of going to great lengths to crack any encryption I would put in. I was tempted to just use base64, perhaps joining the PK and the postcode for example. That might be enough just to obfuscate the id a bit and have a pseudo dual key. Oh well. Thanks anyway. A

Encrpting urls to hide PKs

2011-05-09 Thread ALJ
I have a form that I use to collect contact information from unregistered users. When they submit the form I want to redirect to a confirmation page (as the Django documentation suggests). However, instead of a generic page, I wanted to include the information that they have submitted and the conta

Re: Invalid values in a form cause validation to fail

2011-03-31 Thread ALJ
Hi Karen, Thanks. It looks like I need to upgrade. I was putting it off. Neil On Mar 31, 2:35 am, Karen Tracey wrote: > On Wed, Mar 30, 2011 at 6:34 AM, ALJ wrote: > > Hi Karen, > > > Here is an example that I use to replicate the

Re: Invalid values in a form cause validation to fail

2011-03-30 Thread ALJ
r_or_exclude 516. clone.query.add_q(Q(*args, **kwargs)) File "C:\Python26\lib\site-packages\django\db\models\sql\query.py" in add_q 1675. can_reuse=used_aliases) File "C:\Python26\lib\site-packages\django\db\models\sql\query.py" in add_f

Invalid values in a form cause validation to fail

2011-03-29 Thread ALJ
I have a form within a view which allows users to filter results within a database. The request is a GET because I want the users to be able to bookmark the results. My querystring looks something like: http://127.0.0.1:8001/myapp/?organisation_name=&corporation=4&authorisation_status= My view c

Re: Where does admin.py go?

2011-03-04 Thread ALJ
OK. 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 thi

Where does admin.py go?

2011-03-04 Thread ALJ
Where does "admin.py" actually go? Do you need one for each of your applications or just one in the root of the project. Or does it go in an "admin" directory in your project? (Sorry, for the stupid question. I'm returning to an old project and restructuring it. In the process I have, as you imagi

Re: A better way of checking if a record exists

2010-10-01 Thread ALJ
... what is the infamous obj.__dict__.update() hack? On Oct 1, 11:57 am, bruno desthuilliers wrote: > On 1 oct, 10:29, Shawn Milochik wrote: > > > > > For what it's worth, I use the get_or_create with the 'default' keyword to > > do this: > > > for record in reader: > > >     new_values = { > >

A better way of checking if a record exists

2010-10-01 Thread ALJ
other hand it is probably quicker than ... if models.Retailer.objects.filter(shared_id='1'): customer = models.Retailer.objects.get(shared_id='1') else: customer = models.Retailer() This seems cleaner but doubles the calls to the database. Is the first really th

Re: Patterns / Best practice for automated data refreshes

2010-09-26 Thread ALJ
Hi Shawn, Thanks for that. I'll have a look at using models then. Cheers ALJ On Sep 26, 7:32 pm, Shawn Milochik wrote: > If you're updating a database created by Django, I recommend that your import > script import your Django models and update them with the data. Otherwis

Patterns / Best practice for automated data refreshes

2010-09-26 Thread ALJ
standard sql calls. I also suppose I could convert the spreadsheet to json, and have the databases restart and automatically import the fixture ... although this seems more complicated and probably prone to problems than the above suggestion. ALJ -- You received this message because you are

Re: values() returning more than values

2010-07-22 Thread ALJ
lso mentioned in the documentation if you want more info. Give it a whirl and see how it goes. ALJ On Jul 22, 6:09 pm, Nick wrote: > This is still an issue I'm seeing. I don't know how it can return the > proper count but then when i request the actual values it spits out 9 >

Re: Apache causes full path of django.wsgi path written into url?

2010-07-02 Thread ALJ
... actually ... it has to be the mod_rewrite that is causing the problem with mod_wsgi. But I don't get why. On Jul 2, 11:00 am, ALJ wrote: > I successfully set up a django site to redirect all non secure content > to https. However, I want to bring it back a little and only use

Apache causes full path of django.wsgi path written into url?

2010-07-02 Thread ALJ
I successfully set up a django site to redirect all non secure content to https. However, I want to bring it back a little and only use https for account details and admin ("/accounts" and "/admin"). I've set up a rewrite in apache for those areas and the redirect seems to be working, but it write

Re: Managing the balance between SSL and impact on the server

2010-07-02 Thread ALJ
unsecured connection? So I should be looking at SESSION_COOKIE_SECURE (http:// docs.djangoproject.com/en/dev/topics/http/sessions/)? ALJ On Jul 1, 10:32 pm, ALJ wrote: > Thanks for that Euan. > > Steven, you say you have login on SSL and then have the cookie passed > over unencrypted

Re: Managing the balance between SSL and impact on the server

2010-07-01 Thread ALJ
Thanks for that Euan. Steven, you say you have login on SSL and then have the cookie passed over unencrypted channel for the rest of the site. Is there any risk with this or mitigating steps that should be taken? (Sorry ... don't have my head around it) ALJ On 1 July, 15:20, steven314

Re: Managing the balance between SSL and impact on the server

2010-07-01 Thread ALJ
Hi Erik, Thanks for the advice. I'll certainly have a look at the servers. I just wanted to know really whether it was an "all or none" situation with SSL. If it was possible blend secure and non secure connections. ALJ On Jul 1, 11:13 am, Erik Cederstrand wrote: > Den 01

Managing the balance between SSL and impact on the server

2010-07-01 Thread ALJ
words? Yes, then SSL - Is the content sensitive (like bank details or commercial stuff) ? If yes then SSL. - Are the content and actions user specific? If yes then SSL. ALJ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: How much would you charge for this? £5k? £15k? £50k?

2010-06-21 Thread ALJ
Hi Euan, Cheers for that. It's my first Django project and I think in hindsight I should have started on something a little easier. Nevermind. It's been a good learning experience. Before they told me the spec, they said they thought it would cost about £3k! Cheers ALJ On Jun 2

Re: How much would you charge for this? £5k? £15k? £50k?

2010-06-21 Thread ALJ
... I've just noticed the title and hope this doesn't look too much like spam!! On Jun 21, 11:12 am, ALJ wrote: > I'm just starting out with Django so using an hourly rate isn't really > applicable because I'm going to be much slower that a 'real' >

How much would you charge for this? £5k? £15k? £5 0k?

2010-06-21 Thread ALJ
hem and didn't think it would be necessary. Once bitten Appreciate this is a bit finger in the air, but like I said ... ballparking. ALJ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@g

Caching a queryset

2010-06-20 Thread ALJ
Noob question I have a queryset that holds some very static information (workflow descriptions and attributes) but is used widely throughout by models and views. Is it automatically cached or should I specifically declare somewhere that I want it cached? -- You received this message becaus

Re: inlineformset_factory - minimum number of completed forms and custom validation

2010-06-19 Thread ALJ
... sorry ... I forgot to use formset.non_form_errors() -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@g

inlineformset_factory - minimum number of completed forms and custom validation

2010-06-19 Thread ALJ
Can anyone point me in the right direction regarding customer validation of forms via an inlineformset_factory? I want to make sure at least one form is completed and that no two forms have the same date. (I have to admit, I'm getting confused by how all the different classes relate to each other)

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
Hi again Paulo, Ok. I'll also have a look at that. I agree that the business logic should be in the views. However, it feels that we need a little more flexibility with the templates when things are truely just a presentation problem. When you have to start constructing your own dictionaries / li

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
Just as a matter of interest ... is there a 'best way' of formatting the data if you do decide to process it all in the view and then pass to the template? I seem to have dictionaries coming out of my ears if I construct the data myself. -- You received this message because you are subscribed to

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
Hi Dalore, Thanks for that. I changed it a bit because it was still within that {% for sale in sales %} loop. It works. But it really makes the raw html pretty ugly with loads of spaces in it. Never mind. I suppose no- one is going to see it. {% for rate in rates %} {{ rate.cost_item

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
ng {% if %} 's won't work. I suppose I have to move the logic away. But it seems a bit peculiar to me. Thanks ALJ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegro

Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
I have a template that shows a matrix table of form text input boxes. When the form is new, then it should be just empty text boxes. If data already exists, then the form gets repopulated with data. What I am looking for it this: PRODUCTS | DAY1 | DAY2 | DAY3 POLO | Empty text box | 3 | 3 PASSAT

Event more complicated forms / templates

2010-03-22 Thread ALJ
anything like this? (Again, I think I might have bitten off more than I can chew here!) ALJ >>>>>>>>>>>>>>>>>>>>>>>>>>>>.. models.py class Appointment(models.Model): event = models.ForeignKey(Event) date = m

Re: Multiple polls on a single form

2010-03-18 Thread ALJ
rnet. At the end of the > day I'd say you've got a learning curve in front of you. First forms, > then formsets, then validating them. > > Enjoy. > > On Mar 18, 7:26 pm, ALJ wrote: > > > I have a list of questions and for each a group of potential answers. &g

Multiple polls on a single form

2010-03-18 Thread ALJ
n from scratch and I have to do a number of these (all with slightly different layouts of course). I therefore wondered: - has anyone else done anything similar to this? - are there any examples of how to do it? (I'm not even sure what to call this so I can search for myself.) ALJ --

Re: More tutorials and recipes?

2010-03-18 Thread ALJ
Hi, yes I've had a look at Django book, but was looking for something a bit more advanced than that . Cheers Alj On Mar 18, 2:21 am, Continuation wrote: > Check out the online Django book: > > http://www.djangobook.com/ > > It's somewhat outdated but it covers all the

Re: More tutorials and recipes?

2010-03-17 Thread ALJ
Thanks Alastair ... I'll check it out. On Mar 17, 12:57 pm, Alastair Campbell wrote: > > On Mar 17, 11:23 am, Jirka Vejrazka wrote: > >> > What I am looking for is something that goes beyond the tutorials to > >> > bridge the gap to the detail of the modules. Are there any? > > I found the best

Re: More tutorials and recipes?

2010-03-17 Thread ALJ
Hi Jirka, Cheers for that. I like the cookbook (http://code.djangoproject.com/ wiki/CookBook) ALJ On Mar 17, 11:23 am, Jirka Vejrazka wrote: > > What I am looking for is something that goes beyond the tutorials to > > bridge the gap to the detail of the modules. Are there a

More tutorials and recipes?

2010-03-17 Thread ALJ
I've done the tutorial. This is great. It's practical. You can see how things fit together. But the application is quite simple. I've read the documentation. This tells you how the bits work. But it's quite detailed. What I am looking for is something that goes beyond the tutorials to bridge the

Re: A bit of a modeling question

2010-03-17 Thread ALJ
Hi, Thanks. I can't see the wood for the trees at the moment. Neil On Mar 17, 2:57 am, aditya wrote: > ALJ, > In that case, I think you need multiple models, without inheritance... > > Aditya > > On Mar 16, 1:48 pm, ALJ wrote: > > > Hi aditya, > > >

Re: A bit of a modeling question

2010-03-16 Thread ALJ
gt;   name = > models.CharField(default="Hotels",editable=False,max_length=50) > > class Fixed(Unclassified): >   name = models.Charfield(editable=False,max_length=50) >   cost = > models.DecimalField(max_digits=5,decimal_places=2,editable=False) > > On Mar 16, 9:3

Re: A bit of a modeling question

2010-03-16 Thread ALJ
Hi Preston, Sorry, I don't get it. The certainly do have the same fields, but sometimes the fields are derived from a linked table, or are a foreign key or sometimes text. So I don't understand how having the interface adapt to what the current type is would work. ALJ On Mar 1

Re: A bit of a modeling question

2010-03-16 Thread ALJ
... I suppose this would be the approach for extending a base model. My question is ... does it really matter which approach to take? Does one approach have advanteages or pitfalls? >>. class BaseCost(models.Model): markettingevent = models.ForeignKey(Event) un

A bit of a modeling question

2010-03-16 Thread ALJ
This is a bit of a modeling question that I am struggling to get my head around. How would you model this scenario? I have to record expenses that are of 3 different types. 1. Fixed - The name of the expense and unit amount are fixed. For example, "inconvenience allowance" of £30 per day. 2. Clas

Re: Passing parameters from child models

2010-02-20 Thread ALJ
han this... if hasattr('user','teacher'): current_type = "Teacher" elif hasattr('user','student'): current_type = "Student" elif . everytime I want to find out what type of user I am dealing with. Anyway. Cheers for the

Passing parameters from child models

2010-02-19 Thread ALJ
I want to set a value in a parent model based on the child class. So, in this case, I would set the ExtendedUser.usertype depending on whether its "Teacher" or "Student". I tried looking at using '%(class)s' to get the class name, but that didn't work. Or can you explicitly pass values from the ch

Re: Managing different user types

2010-02-19 Thread ALJ
ulti-table-inheritance-vs-specifying-explicit-onetoone-relationship-in-mo ALJ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send em

Re: Multiple user types

2010-02-19 Thread ALJ
... here's a solution I found really useful. It uses a base profile with inheritance. http://stackoverflow.com/questions/1796556/django-multi-table-inheritance-vs-specifying-explicit-onetoone-relationship-in-mo ALJ -- You received this message because you are subscribed to the Google G

Re: User permissions to see a view

2010-02-19 Thread ALJ
I am restricting access to particular pages. The reports page doesn't have a particular model. It's going to have some 'flat' content and links to lots of other reports. So that is why I was confused. There is no underlying data model for that page. I was going to query rebus's suggestion. I didn'

Re: User permissions to see a view

2010-02-18 Thread ALJ
eignKey(User, unique=True) usertype = models.ForeignKey(UserType) address01 = models.CharField(max_length=50, null=True) address02 = models.CharField(max_length=50, null=True) ... >>>>>>>>>>>>>>>>>>>>>>>>>>

Re: User permissions to see a view

2010-02-18 Thread ALJ
Hi Alexey, But how do you set a permission for a view? There's no underlying model to which to add the custom meta permissions. ALJ On Feb 18, 12:48 pm, Alexey Kostyuk wrote: > On Thu, 2010-02-18 at 02:30 -0800, ALJ wrote: > > First project and struggling a bit. > > > I

User permissions to see a view

2010-02-18 Thread ALJ
First project and struggling a bit. I have some views that I want to restrict access to, depending on user type. How do I do that? For example, I have a 'reports' view that I only want teachers to see ... not students. I can't see how to create a custom permission because there is no underlying m

Re: Managing different user types

2010-02-11 Thread ALJ
OK ... It was raving a bit there. I didn't actually expect anyone to answer all those questions. On Feb 10, 1:27 pm, ALJ wrote: > I appreciate that this is a very common question. I have searched > through the forums and now totally confused. There seems to be loads > of dif

Managing different user types

2010-02-10 Thread ALJ
le, when a new teacher is added to users, you code so that they are automatically set to the Teachers Authorisation Group? - "Authentication data in templates" (http://docs.djangoproject.com/en/ 1.1/topics/auth/#authentication-data-in-templates) [ah!!!] ALJ -- You re